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

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
tomphantoo
Forum Members
Forum Members
Posts: 15
Joined: Mon Apr 11, 2011 7:33 am

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

Post 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>
tomphantoo
Forum Members
Forum Members
Posts: 15
Joined: Mon Apr 11, 2011 7:33 am

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

Post 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.
EricG
Forum Members
Forum Members
Posts: 29
Joined: Tue May 02, 2006 1:46 pm
Location: Apeldoorn

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

Post 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.
nicmare
Power Poster
Power Poster
Posts: 1150
Joined: Sat Aug 25, 2007 9:55 am
Location: Berlin

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

Post 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?
EricG
Forum Members
Forum Members
Posts: 29
Joined: Tue May 02, 2006 1:46 pm
Location: Apeldoorn

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

Post 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
Post Reply

Return to “Modules/Add-Ons”