Page 1 of 1

How to get 'returnto' to work after user logout?

Posted: Mon Apr 25, 2011 1:47 am
by tomphantoo
I can't get 'returnto' to work after user logs out. With the setup detailed below, clicking the logout button on the logout page clears the content of that page, and displays the login link in the header, but does not change page.

What can I do to fix this?

I've tested with omitted parameter(s) (combinations of form, returnto) without success (actually, in one case after logout it showed the login page immediately).

On the login page, a 'returnto' option in the module tag works as expected.

I'm using 1.9.4.1
In the page template (for display in each page's header):
{ if $ccuser->loggedin() }
{cms_selflink page="logout" text="Logout"} {$ccuser->username()}
{else}
{cms_selflink page="login" text="Login"}
{/if}

In the logout page content block:
{cms_module module='FrontEndUsers' form='logout' returnto='home'}

In the logout template:
<p>So, {$username}, you want to <a href="{$url_logout}" title="{$mod->Lang('info_logout')}">{$mod->Lang('logout')|lower}</a> ...</p>

Re: How to get 'returnto' to work after user logout? SOLVED

Posted: Thu Jun 09, 2011 2:02 am
by tomphantoo
Plowing through the code of the FrontEndUsers module, I found that it effectively ignores the 'returnto' parameter during any logout.
I've fixed mine, and would be happy to post the changes.
However I also needed, and implemented, some hooks for returning to anywhere after logout, not just to a specified page ('returnto'=....) or to the page where the logout form is ('returnlast'=1).
So a little bit of work is needed to distinguish the fixes from the additions, in a global diff.
Anyhow, it's available for the asking.

Re: How to get 'returnto' to work after user logout? SOLVED

Posted: Wed Jun 15, 2011 5:10 pm
by EricG
tomphantoo wrote: Anyhow, it's available for the asking.

Hello tomphantoo, was also strugling with this returnto in the logoput form for FEU. I'd like to know the solution if you don't mind.

thanks.

Re: How to get 'returnto' to work after user logout?

Posted: Thu Jun 16, 2011 7:37 pm
by nicmare
did you guys check out the settings of FEU? there you can set the page_id of the page you want to open after logging out. or am i missing something?

Re: How to get 'returnto' to work after user logout?

Posted: Fri Jun 17, 2011 4:50 pm
by EricG
nicmare wrote:did you guys check out the settings of FEU? there you can set the page_id of the page you want to open after logging out. or am i missing something?

Yes checked out the settings of FEU... this is my code for logout and to return to a paga of my choice

Code: Select all

{cms_module module=FrontEndUsers form='logout' returnto='63'}
Doesn't matter if I use returnto='63' or returnto='page-alias'

Logout won't go the the reurnto page