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.
User avatar
Soul Reaver
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Mar 24, 2008 10:27 pm
Location: Oz

Re: No auto login redirect to same page anymore?

Post by Soul Reaver » Mon Mar 02, 2009 10:44 pm

Any updates on this as yet???

I thought i was losing my mind when upgraded to 1.5.9 and the login module redirects to home, but after reading this i can see it's an issue.

I agree with the majority here, when a user logs in via the login module they should be put back on the same page not home.
I'm new be gentle :O

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: No auto login redirect to same page anymore?

Post by dextercowley » Thu Mar 05, 2009 10:51 pm

Hi. We have a patch for this issue. We now need people to test it. Here is the link: http://joomlacode.org/gf/project/joomla ... m_id=15376. If we can get it successfully tested by two people, it can go into the next Joomla! release. Thanks! Mark
Mark Dexter
"Well...how did I get here?"

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: No auto login redirect to same page anymore?

Post by infograf768 » Fri Mar 06, 2009 8:03 am

Having some issues, Mark. Posting on joomlacode.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

dlebreux
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Jul 24, 2008 2:20 am

Re: No auto login redirect to same page anymore?

Post by dlebreux » Fri Mar 06, 2009 8:01 pm

Sorry, still a newbie....how did I install & test the .patch file?

I'd love to help move this along.

I also have DOCman installed and I'd like to make sure that it works with that as well too.

thanks to all for pushing forward with this. Really appreciated.

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: No auto login redirect to same page anymore?

Post by dextercowley » Fri Mar 06, 2009 8:35 pm

Hi. Well, to install a patch you need to have a copy of Joomla! under Subversion source control. One way to do that is to use Eclipse with Subversion. It's a fair bit of setup, but worth it if you want to use an IDE for PHP/Joomla! development. Here is a link with detailed instructions: http://docs.joomla.org/Setting_up_your_ ... evelopment.

If you don't want to go through all of that, in this case it's pretty easy to manually make the change. The patch file looks like this:

Code: Select all

Index: modules/mod_login/helper.php
===================================================================
--- modules/mod_login/helper.php	(revision 11645)
+++ modules/mod_login/helper.php	(working copy)
@@ -26,7 +26,9 @@
 		}
 		else
 		{
-			$url = JURI::base(true);
+			// stay on the same page
+			$uri = JFactory::getURI();
+			$url = $uri->toString(array('path', 'query', 'fragment'));
 		}
 
 		return base64_encode($url);
So this is telling you to go down to line 26 in the file modules/mod_login/helper.php and find the lines shown below that. Delete the line "$url = JURI::base(true);" and add in it's place the three lines with "+".

Hope this helps. Mark
Mark Dexter
"Well...how did I get here?"

metaltome
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Fri Jan 23, 2009 7:47 pm

Re: No auto login redirect to same page anymore?

Post by metaltome » Mon Mar 16, 2009 7:21 pm

I have applied the hack above to the latest version of Yoologin 1.5.9 and am hosting the fixed file on my server. It will keep users on whatever page they choose to login at. Just keep the redirection settings on:

- Select Item -

Simply Install via Joomla Backend! Enjoy!

http://www.metaltome.com/downloads/mod_ ... 9Fixed.zip

dlebreux
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Jul 24, 2008 2:20 am

Re: No auto login redirect to same page anymore?

Post by dlebreux » Mon Mar 16, 2009 7:59 pm

I applied the patch (manually) as well and it seems to be working fine.
I'm on J! 1.5.9 with a LAMP set up.
This is on an internal company website so I can't share the link but I'll let you know if anything odd happens.
But so far so good.

Thanks A MILLION for doing this. :D

My users will be VERY happy.

User avatar
Soul Reaver
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Mon Mar 24, 2008 10:27 pm
Location: Oz

Re: No auto login redirect to same page anymore?

Post by Soul Reaver » Tue Mar 17, 2009 10:39 pm

Above patch applied, working as expected. Thank you to all involved in this, hoping this is corrected in the next release.
I'm new be gentle :O

User avatar
dextercowley
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 3286
Joined: Sun Apr 06, 2008 4:44 am
Location: Seattle, WA, USA

Re: No auto login redirect to same page anymore?

Post by dextercowley » Tue Mar 17, 2009 11:23 pm

Hi. Yes, this issue is corrected in the SVN, which means that it will be included in version 1.5.10. Mark
Mark Dexter
"Well...how did I get here?"

razzle
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Tue Nov 06, 2007 3:48 am

Re: No auto login redirect to same page anymore?

Post by razzle » Thu Mar 19, 2009 11:38 pm

metaltome wrote:I have applied the hack above to the latest version of Yoologin 1.5.9 and am hosting the fixed file on my server. It will keep users on whatever page they choose to login at. Just keep the redirection settings on:

- Select Item -

Simply Install via Joomla Backend! Enjoy!

http://www.metaltome.com/downloads/mod_ ... 9Fixed.zip
Metaltome... YOO are da'MANNNN! Thanx from a grateful user! ;D You're the guy that makes Joomla! the best CMS on the planet!!!

saintwright
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 26, 2009 3:32 am

Re: No auto login redirect to same page anymore?

Post by saintwright » Thu Mar 26, 2009 3:35 am

Hi - I have tried changing the code as requested but I still get returned to the index page - and I have not selected any pages in the login module. Any ideas??

dlebreux
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Jul 24, 2008 2:20 am

Re: No auto login redirect to same page anymore?

Post by dlebreux » Thu Mar 26, 2009 4:34 am

My only thought (simple as it may be) is that you didn't edit the code properly.
When I first did this (not having any experience with PHP) I added the code as displayed.
After re-reading and testing I found out that you need to delete that first line and then show the next 3 wthout the + sign.
Sounds stupid but that's what got me for a minute. :-[

saintwright
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 26, 2009 3:32 am

Re: No auto login redirect to same page anymore?

Post by saintwright » Thu Mar 26, 2009 7:27 am

I did remove the + and -: see code below.

function getReturnURL($params, $type)
{
if($itemid = $params->get($type))
{
$menu =& JSite::getMenu();
$item = $menu->getItem($itemid);
$url = JRoute::_($item->link.'&Itemid='.$itemid, false);
}
else
{
// stay on the same page
$uri = JFactory::getURI();
$url = $uri->toString(array('path', 'query', 'fragment'));

}

return base64_encode($url);
}

dlebreux
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Jul 24, 2008 2:20 am

Re: No auto login redirect to same page anymore?

Post by dlebreux » Thu Mar 26, 2009 1:02 pm

And you're sure the Login Module doesn't show a redirect page anymore, correct?

The fix for this is going to be in 1.5.10 and that's expected to be released some time this week.

I didn't have time now to review what you added but I might later today. If anyone else can help out please jump in.

saintwright
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Mar 26, 2009 3:32 am

Re: No auto login redirect to same page anymore?

Post by saintwright » Thu Mar 26, 2009 10:53 pm

Ok - thanks for your help - but I have been a bit dumb - or I can blame my newbie status with Joomla - I needed to add the return url into a querystring that calls the login page as I am not using the login module but the login page. So I have got it working - by chaning teh url to:

/joomlamums/index.php?option=com_user&view=login&Itemid=69&return=<?php echo $returnurl; ?>

Thanks again for answering my questions!

S :-[

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?

Post by mlipscomb » Sat Mar 28, 2009 5:40 am

Thanks a lot of the mod.

If anyone needs to see it in action it is up and going at http://www.foodcreate.com

A quick side note - if you have this published and have already messed with a redirect, make sure you set it back to none - otherwise it will continue to redirect custom. I know most of y'all will automatically know that - but there are those that it can frustrate after way too many tries! :-)
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

dlebreux
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Thu Jul 24, 2008 2:20 am

Re: No auto login redirect to same page anymore?

Post by dlebreux » Mon Mar 30, 2009 1:30 pm

FYI - now that 1.5.10 is out there's no need for self patching the file. Just update Joomla! to the latest version and the login should work fine.

xt4london
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Nov 19, 2007 9:00 pm
Location: London
Contact:

Re: No auto login redirect to same page anymore?

Post by xt4london » Mon Apr 20, 2009 12:19 pm

I've used this hack for the login MODULE and it works!. What about the COMPONENT? Will it work for that too?

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?

Post by mlipscomb » Mon Apr 20, 2009 2:28 pm

What component?
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

xt4london
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Nov 19, 2007 9:00 pm
Location: London
Contact:

Re: No auto login redirect to same page anymore?

Post by xt4london » Tue Apr 21, 2009 12:24 am

By component I mean when say you have a restricted page and a user attempts to go to that page and a log in screen is called. This is not the same as the login module (although it looks the same). Or it's when you create a menu log in. This creates a component log in as opposed to a module log in. The hack above works for the module but not the component.

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?

Post by mlipscomb » Tue Apr 21, 2009 12:49 am

if you upgrade to 1.5.10 it handles this.
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

zoink
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Mar 09, 2009 7:28 pm

Re: No auto login redirect to same page anymore?

Post by zoink » Wed Apr 22, 2009 8:23 am

No, 1.5.10 does not correct the problem for the login component, only the module. If you create a login menu item (User -> Login menu item type) or call up the com_user component's login view directly with an external link menu item, then attempt to login, you will not be redirected to the same page you came from (referrer page).

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?

Post by mlipscomb » Wed Apr 22, 2009 3:33 pm

Oh - I see what you're talking about. Instead it just stays on the login page or redirects to account details, right?
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

zoink
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Mar 09, 2009 7:28 pm

Re: No auto login redirect to same page anymore?

Post by zoink » Thu Apr 23, 2009 4:44 am

That's correct. It simply takes you to a redirect page that you can choose from your available menu items (if you arrive at the login view through a menu by clicking on a User->Login menu item type where you've configured the redirect settings) or to the index page (if you don't configure the redirect settings or you arrive at the login view through a menu item of type "External" which links to the index?option=com_user&view=login directly). This is very limiting because redirect to the page the user came from is a feature needed by a lot of people, and the login view of the component should have the same behavior as the module so there is flexibility in designing a site without a whole bunch of weird quirks...

xt4london
Joomla! Apprentice
Joomla! Apprentice
Posts: 30
Joined: Mon Nov 19, 2007 9:00 pm
Location: London
Contact:

Re: No auto login redirect to same page anymore?

Post by xt4london » Thu Apr 23, 2009 1:09 pm

Agree with Zoink on this but what is really needed is the ability to go to the restricted page (the page that you need to be logged in to see) once the log in has happened.

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?

Post by mlipscomb » Thu Apr 23, 2009 3:23 pm

I really think that having that be an "option" compared to automatic would be the best route since sometimes it's needed to go directly to the account page (especially if other advanced options for profile editing are used.)

Would anyone be interested in using a different component for the menu login link? That way for our needs you still have the option of directing users through the regular com_login or using the different component for previous page redirect.
~Matt Lipscomb
http://www.USAFreelancers.org
Professional Joomla! Services and Web Development based in the USA

zoink
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Mar 09, 2009 7:28 pm

Re: No auto login redirect to same page anymore?

Post by zoink » Fri Apr 24, 2009 1:25 am

As long as it functioned the same as and possibly even just utilized the normal com_user component's login view, I would be interested. The only thing that's really needed is to find the redirect URL (current page), base64 encode it, and stick it onto the end of the query string of the link generated by the menu item.

Example:

index.php?option=com_user&view=login&return=qopa93jAkzjrhkjAEU

where return is the base64-encoded return URL

This could probably be done with a new component implementing this functionality and accessed through a new menu item type.

Also, it would be helpful to have the same for a logout menu item.

However, I'm not sure if it's possible to dynamically generate the link URL for a menu item on page load...

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

Re: No auto login redirect to same page anymore?

Post by mcsmom » Tue Apr 28, 2009 10:28 am

If you click on a login link, the referrer page IS the login page. What you want is to go to the page before the referrer page. There has never been that feature, although it sure would be cool.
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!.

zoink
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Mar 09, 2009 7:28 pm

Re: No auto login redirect to same page anymore?

Post by zoink » Sun May 10, 2009 12:51 am

Not the referrer to the post action, I was referring to the referrer of the login page request. Do you get my reference?

I refer you to my previous posts.

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

Re: No auto login redirect to same page anymore?

Post by David0204 » Tue May 12, 2009 11:07 pm

Hello all. Any new development on this issue? I just upgraded my site to 1.5.10 and still have the same problem: after you login in the Kunena discussion forum you are redirected to Home instead of the actual discussion forum.

Any new hack on this?

thanks

David


Locked

Return to “Joomla! 1.5 Bug Reporting”