Logging in ignores current /layout/set URI

Author Message

Dan C

Tuesday 29 March 2005 2:08:53 pm

Hi,

Here's my situation:
If I'm browsing on my site at:

http://www.example.com/layout/set/mylayout/mymodule/view/42

and I click to login from that page, after I login I'm redirected to:

http://www.example.com/mymodule/view/42

instead of the original url. Does anyone know a workout or a fix for this? I looked into kernel/user/login.php and user/login.tpl and theres a UserRedirectURI variable that might do what I'm looking for but I'm not sure how to set it.

Any advice would be greatly appreciated

Thanks,

Dan

Łukasz Serwatka

Tuesday 29 March 2005 11:51:07 pm

Hi Dan,

Could you paste xhtml output from

<input type="hidden" name="RedirectURI" value="{$User:redirect_uri}" /> 

Probadly redirect_uri is wrong.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Dan C

Wednesday 30 March 2005 3:59:05 am

It's the same:

Mine:
<input type="hidden" name="RedirectURI" value="{$User:redirect_uri}" />
Yours:
<input type="hidden" name="RedirectURI" value="{$User:redirect_uri}" /> 

Any ideas?

Dan

Łukasz Serwatka

Wednesday 30 March 2005 4:03:06 am

What is the output from {$User:redirect_uri} variable when you accessing http://www.example.com/layout/set/mylayout/mymodule/view/42

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Dan C

Wednesday 30 March 2005 6:21:29 am

http://www.example.com/layout/set/mylayout/mymodule/view/42

has a link to http://www.example.com/user/login

and the output of {$User:redirect_uri} is:

<input type="hidden" name="RedirectURI" value="" />

Dan C

Monday 02 May 2005 7:29:45 pm

I hacked up a solution to call a function in a module.. that returns _SERVER['HTTP_REFERER'] which i put into the UserRedirect hidden field... this is really hackish and I would prefer a proper solution but going through the ezpublish code is too daunting.

I have some vague idea that it has to do with lib/ezutils/ezuri.php and perhaps even kernel/user/login.php but I can't find where the layout/set URI part is stored.

Maybe this was fixed after 3.5.0? Can someone backport the necessary changes?

Thanks,

Dan

Lo' F.

Tuesday 31 May 2011 7:08:02 am

Old post but I had the same issue: after logging in I was redirected to the home while I wanted to be redirected to the last visited page.

{$User:redirect_uri|wash} did not output anything but an empty value.

So just figured out this as the easiest way..

<input type="hidden" name="RedirectURI" value="{ezhttp( 'LastAccessesURI', 'session' )}" />

..Cheers!

loredanaebook.it

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.