No auto login redirect to same page anymore?

This forum is for reporting bugs in Joomla!. Please don't report problems with extensions in here.
Forum rules
Forum Rules
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
User avatar
mlipscomb
Joomla! Ace
Joomla! Ace
Posts: 1271
Joined: Thu Mar 26, 2009 5:38 pm
Location: Gadsden, AL
Contact:

Re: No auto login redirect to same page anymore?

Postby mlipscomb » Wed May 13, 2009 1:22 am

Hi David...

Why do you have to login to the Kunena forum? This should be handled automatically after logging in to the main site.
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Wed May 13, 2009 1:38 am

Hello mlipscomb,

There is no other modules or sections where our users need to login so we didn't enable the login form for the whole site. The login to the Kunena forum is done in the forum page BUT it uses the global login module.

Please give it a look here:

http://76.74.229.4/~malmoweb/index.php? ... Itemid=122

The site is still in testing phase so there are a couple of typos

Thanks a lot

David

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: No auto login redirect to same page anymore?

Postby mcsmom » Wed May 13, 2009 1:44 am

David,

You can set the page to redirect to in the login module. So for the module on the kunena page, set it to redirect to that page.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Wed May 13, 2009 2:49 am

Hello mcsmom,

Thanks for your reply. I already tried that. The problem is that you can set the page to redirect in the login FORM module but, as the Kunena forum uses the mod_login directly (without the settings in the form), it bypassed the seetings of the form.

Do you know if there is a line in the php to change the page to redirec?

Thanks

David

User avatar
mcsmom
Joomla! Exemplar
Joomla! Exemplar
Posts: 7985
Joined: Thu Aug 18, 2005 8:43 pm
Location: New York
Contact:

Re: No auto login redirect to same page anymore?

Postby mcsmom » Sat May 16, 2009 6:14 pm

The login module lets you select a redirection page.
So we must fix our vision not merely on the negative expulsion of war, but upon the positive affirmation of peace. MLK 1964.
http://officialjoomlabook.com Get it at http://www.joomla.org/joomla-press-official-books.html Buy a book, support Joomla!.

User avatar
salo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Oct 28, 2006 1:02 am

Re: No auto login redirect to same page anymore?

Postby salo » Fri May 29, 2009 1:53 am

The problem has been fixed in 1.5.10 release.
If you are using yoologin module then you should modify a helper.php that comes with it
find and replace this :

Code: Select all

$url = JURI::base(true);

with this:

Code: Select all

         //stay on same page
         $uri = JFactory::getURI();
         $url = $uri->toString(array('path', 'query', 'fragment'));

the redirection page in module parameters must be NOT SET (aka -Select Item-)

dannygsam
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Wed Sep 17, 2008 4:37 am

Re: No auto login redirect to same page anymore?

Postby dannygsam » Tue Jun 23, 2009 7:13 am

I did not understand any of these.. all that I know now is that if a login menu is created or a login module is created it never redirects to the same page anymore.. and I still have to hav this problem on all my sites.

Can this also happen if SH404SEF is implemented?

User avatar
salo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Oct 28, 2006 1:02 am

Re: No auto login redirect to same page anymore?

Postby salo » Tue Jun 23, 2009 7:31 am

My login redirect to the same page on joomla 1.5.10-1.5.11
do you use default login module or yoologin?
what joomla version?

dannygsam
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Wed Sep 17, 2008 4:37 am

Re: No auto login redirect to same page anymore?

Postby dannygsam » Tue Jun 23, 2009 8:51 pm

I have 1.5.11 and use the default login module..

User avatar
salo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Oct 28, 2006 1:02 am

Re: No auto login redirect to same page anymore?

Postby salo » Wed Jun 24, 2009 2:16 am

did you set redirection page to "none" (-Select item-)?
where is it redirecting now?

dannygsam
Joomla! Intern
Joomla! Intern
Posts: 69
Joined: Wed Sep 17, 2008 4:37 am

Re: No auto login redirect to same page anymore?

Postby dannygsam » Wed Jun 24, 2009 4:12 am

Salo, I think I said it wrong.

I am mentioning about the login menu.. I create a login menu.. and in login redirection settings I set that after they login they should be directed to the Events section. But when they login they are directed to the home page..

User avatar
salo
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Oct 28, 2006 1:02 am

Re: No auto login redirect to same page anymore?

Postby salo » Wed Jun 24, 2009 4:57 am

this is probably issue for different thread, but i have to say that my joomla (1.5.11) works fine with redirection.

fulltimedad
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 08, 2009 5:18 pm

Re: No auto login redirect to same page anymore?

Postby fulltimedad » Wed Jul 08, 2009 5:47 pm

I have read through this thread numerous times, and I am still unsure what the resolution to this problem is.

Here is my problem:

I have a menu item named Login that appears on every page on my site. It was created using the User » Login type. I have the option when setting up the menu item to indicate the "Login Redirection URL" (note that this not a reference to any other menu item via a drop-down menu).
The tool tip states that "If left blank, the default setting is the front page."

As far as I can tell, there is no option (after a successful login) to return the user to the page they were on when they clicked on "Login". Since the menu item appears on every page of the site, I cannot know which page was active when they chose to login.

As I read through this thread, I thought that this is the problem that was being discussed and that several responses indicated that a solution had been incorporated in the latest updates. I have just updated from 1.5.9 to 1.5.12, and I find that this is not the case. Leaving the URL blank continues to redirect the user to the front page, just as the tooltip suggests.

Am I reading this wrong? Is there a way to get a successful login to return the user to the page they were on when deciding to login?

tejas_zwt
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Wed Oct 24, 2007 9:39 am

Re: No auto login redirect to same page anymore?

Postby tejas_zwt » Fri Aug 07, 2009 9:09 am

I am facing same problem like fulltimedad posted above.

I had put one login link in registered restricted area, after click on that it redirect to login page(component) then successfully login redirects to frontpage but i want redirect to that page which was restricted earlier.

Please any Joomla master give solution for this.

rjs
Joomla! Explorer
Joomla! Explorer
Posts: 459
Joined: Fri Jan 20, 2006 11:09 pm
Location: US-IL
Contact:

Re: No auto login redirect to same page anymore?

Postby rjs » Thu Aug 20, 2009 6:20 am

Hmm.. I looked all over and found this thread. What happened to Joomla? All this redirection is making one dizzy here. I'm using 1.5.14 and it still isn't fixed correctly it appears. When a person logs in a site, you shouldn't be redirected. Another issue I am having is the signup form. It won't stay on the same page. It redirects to the front page (which is a different template installation) when creating an account. If out of the code posted in the thread something works to keep on the page your supposed ot be on, would someone post again the latest working code. Thank you.
==
Best Regards, --rjs

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Thu Aug 20, 2009 3:53 pm

Thanks rjs- I hope that if a Joomla! Guru complains about this problem someone will finally try to understand that we in deed have a problem with the login module and redirecting function.... yes, it is true, many of us are novices but this is a real problem!
We have being dealing with this for almost nine months...

Thanks

David

rjs
Joomla! Explorer
Joomla! Explorer
Posts: 459
Joined: Fri Jan 20, 2006 11:09 pm
Location: US-IL
Contact:

Re: No auto login redirect to same page anymore?

Postby rjs » Thu Aug 20, 2009 5:30 pm

There are a few hard coded redirects, and the one in question redirects to index. Changed a few redirects and
solved the situation for now but this needs corrected. It's pure and simple not an effective way to keep visitors if you redirect them. Some would even consider it rude.

On or around line 288 in /components/com_user

Code: Select all

 $this->setRedirect('index.php', $message);

This is for the registration. You can alter this to what you need.

Quite a few people alter their main home page to where they remove the "main" content area and use modules for various purposes. This in some cases removes the showing of the

Code: Select all

$message
In a case like that, you certainly do not want to redirect or the user will not see any of the messages they are supposed to be seeing. And it's apparent this would pose issues with a redirect to a page designed not to show $message . Doing design work around hard coded links and redirects is not all that appealing. All the hard work at separating content and function for this.
==
Best Regards, --rjs

fulltimedad
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 08, 2009 5:18 pm

Re: No auto login redirect to same page anymore?

Postby fulltimedad » Thu Aug 20, 2009 6:54 pm

Thanks rjs, that will help if we have one page in particular we want to redirect to.

The original problem discussed in this thread has still not been addressed. There needs to be some way to redirect the user back to the page they left when they decided to login. According to this thread that used to be the default, and somewhere along the line, it was changed. There was a promise to return the function earlier in this thread (several versions of Joomla ago). Let's hope there is some follow through.

rjs
Joomla! Explorer
Joomla! Explorer
Posts: 459
Joined: Fri Jan 20, 2006 11:09 pm
Location: US-IL
Contact:

Re: No auto login redirect to same page anymore?

Postby rjs » Thu Aug 20, 2009 8:26 pm

Yes fulltimedad, I do understand the issues. Simply looking for a fix for the more glaring index redirects for a current project.

The fact is, and as you have pointed out, none of the pages should be redirected to a hard coded page anyhow. If you login on a certain page, you shouldn't require a redirect of any kind. Which is the key goal here. To keep people on the page they intended to be on. In the case of the login page, or any other page, once logged in, they should be redirected to the original page they used to get to the login. This is understood, but it will require the Joomla dev team to re-think their ideas on this hard coded redirection usage currently in the code. There are link input forms for the login form, but it doesn't resolve the issues with hard coded redirections. For the time being I'm just looking for code/fixes/changes for the more glaring issues.
==
Best Regards, --rjs

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Thu Aug 20, 2009 9:53 pm

Thanks for your time and effort rjs. You are right, many users find really confusing to be redirected to somewhere else after login.... but I hope we are in the right track now

David

fulltimedad
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Wed Jul 08, 2009 5:18 pm

Re: No auto login redirect to same page anymore?

Postby fulltimedad » Thu Aug 20, 2009 11:11 pm

rjs

I realize what you were helping with a quick fix, and I thank you for that. I did not mean to imply that you didn't understand the final goal. I'm just trying to get the attention of someone on the development team to look at the situation, just as you suggested.

lipoftruth
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jun 20, 2009 11:04 am

Re: No auto login redirect to same page anymore?

Postby lipoftruth » Sun Aug 23, 2009 7:22 am

I hope there is going to be a solution for this soon! I am having teh same problem, ie. I have a login module on every page and some things are available only to registered members. If a person comes to the page to download a song, for example, and forgot to log in, when they log in on the song page, they are now redirected to the home page. I just want them to stay on the same page that they logged in from. I assumed this would be easy, but I can't find any answer on joomla. Is there any dev that can help us??!

PS: Funnily enough, I wasn't logged in when I started typing this message, so I had to log in, and then I was taken to the index page. Because I found this thread via search, I had to search for it again to come back to the page after logging in!! Very frustrtating!

lipoftruth
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jun 20, 2009 11:04 am

Re: No auto login redirect to same page anymore?

Postby lipoftruth » Sun Aug 23, 2009 3:14 pm

I FOUND THE ANSWER!!! (I looked at some code that was use for a same page no redirect on Kunena and applied it to the mod_login on Joomla and it worked!).

With this, if you set the login module to redirect to none (ie. leave it on "select page") they will just stay on the SAME PAGE that they log in. Otherwise, if you want them to be redirected to a specific page, you have to set it to that page.



Go to 'your site'/modules/mod_login/helper.php

You will see an entry like this:

***** Manual signatures are NOT allowed *****

{
if($itemid = $params->get($type))
{
$menu =& JSite::getMenu();
$item = $menu->getItem($itemid);
$url = JRoute::_($item->link.'&Itemid='.$itemid, false);
}
else
{
$url = JURI::base(true);
}

***** Manual signatures are NOT allowed *****


change the "else" statement to this:

else
{
// stay on the same page
$uri = JFactory::getURI();
$url = $uri->toString(array('path', 'query', 'fragment'));
}


Then save. Now every time someone logs in to whatever page they are on, they will stay on that page after their login is successful.

I hope this is of help to people

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Sun Aug 23, 2009 5:21 pm

Hi lipoftruth-

You did a great job, thanks for putting your time in researching this. Unfortunately this is a partial fix that was reported earlier in the discussion and implies that users MUST log in using the "Login Form" instead of the Login function/button in the Kunena Forum. For a working example, please follow the link below. You will see that, if you login-in into the Kunena Forum using the "Login Form" in the left, you will stay in the same page BUT if you use the "Login" button in the Kunena template (located below the Welcome message) you will be redirected to the Home page. Please use the user/pass TestUser/sandia

http://malmoplains.com/index.php?option ... Itemid=122

Have a great weekend

rjs
Joomla! Explorer
Joomla! Explorer
Posts: 459
Joined: Fri Jan 20, 2006 11:09 pm
Location: US-IL
Contact:

Re: No auto login redirect to same page anymore?

Postby rjs » Sun Aug 23, 2009 10:45 pm

17 posts up is the same answer. Must be the thang to do. I've fixed most of what I needed but I've hacked quite a few files, both core and plugins. Upgrading isn't going to be pleasant.
==
Best Regards, --rjs

User avatar
airton
Joomla! Ace
Joomla! Ace
Posts: 1369
Joined: Sun Nov 04, 2007 1:12 am
Location: Brazil
Contact:

Re: No auto login redirect to same page anymore?

Postby airton » Sun Aug 23, 2009 11:37 pm

Hi guys,

I want to contribute to this thread and maybe we can find a solution to that.

There are two main problems here:
a) login through the login form (mod_login)
b) login through the login page (com_login)

I ran a few tests with J1.5.14 and (a) has already been solved and implemented in the package with the code suggested by lipoftruth and salo.

The problem remains for the login page. If we create a menu item with type Login or navigate directly to example.com/index.php?option=com_user&view=login or use the link in Kunena as posted by David0204 (by the way, couldn't test in your site - bad username/password), we are redirected to a new content (the login form) and Joomla looses track of where it came from. After a successful login, we're redirected to the front page by a hard coded redirect. This doesn't happen for read more links and direct links to restricted content.

I'll investigate this further to see if I can find a solution. If so, I'll post it here and propose a patch to correct this for the next release.

At the moment, I'm looking at the code in /components/com_user/controller.php at lines 143 to 164 that is responsible for the redirecting after login.

I'll keep you posted.

Regards,
Airton Torres
Joomla Bug Squad http://groups.google.com/group/joomlabugsquad
Community website - http://community.joomla.org
Unsolicited support PMs will be deleted and the user added to the foes list.

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Mon Aug 24, 2009 12:12 am

Hi airton. Sorry about the username/password. The correct combination is TestUsuario/sandia... sometimes I get all mixed up between English and Spanish.

Please test it now and let us know if there is anything new

Thanks

lipoftruth
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jun 20, 2009 11:04 am

Re: No auto login redirect to same page anymore?

Postby lipoftruth » Mon Aug 24, 2009 4:06 am

David0204 wrote:Hi lipoftruth-

You did a great job, thanks for putting your time in researching this. Unfortunately this is a partial fix that was reported earlier in the discussion and implies that users MUST log in using the "Login Form" instead of the Login function/button in the Kunena Forum. For a working example, please follow the link below. You will see that, if you login-in into the Kunena Forum using the "Login Form" in the left, you will stay in the same page BUT if you use the "Login" button in the Kunena template (located below the Welcome message) you will be redirected to the Home page. Please use the user/pass TestUser/sandia

http://malmoplains.com/index.php?option ... Itemid=122

Have a great weekend



Actually, the way I found out how to do it for the Joomla login, was because i first did it for the KUNENA login, by following the instructions on the the following page:
http://www.kunena.com/forum/144-hacks-t ... ogin#25979

Now whether I log in with teh Joomla login form or the Kunena login form, I stay on the same page. I hope it is of help to people.

lipoftruth
Joomla! Intern
Joomla! Intern
Posts: 52
Joined: Sat Jun 20, 2009 11:04 am

Re: No auto login redirect to same page anymore?

Postby lipoftruth » Mon Aug 24, 2009 4:08 am

rjs wrote:17 posts up is the same answer. Must be the thang to do. I've fixed most of what I needed but I've hacked quite a few files, both core and plugins. Upgrading isn't going to be pleasant.


Sorry about that. Somehow I missed the answer. I wish I hadn't as I had to spend a lot of time figuring it out myself! Sorry for the double up.

David0204
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Sun Mar 22, 2009 12:11 am

Re: No auto login redirect to same page anymore?

Postby David0204 » Mon Aug 24, 2009 4:22 am

Hi lipoftruth

Thanks for the link to the instructions. Just to be absolutely sure: we are talking about overwriting the profilebox.php file with the patched version offered by @quila right?

David


Return to “Joomla! 1.5 Bug Reporting”

Who is online

Users browsing this forum: No registered users and 6 guests