Hi - I just need the “logout” function in expression engine to return a user to the current url after logout. By default, it sends a user to the site root. I isolated the line which handles the redirect:
$url = ( ! isset($url)) ? $this->EE->config->item('site_url') : $url;and I want to modify it so that instead of using ‘site_url’ - it uses the current URL, which in code igniter is found with the function current_url(). Is there a way to modify the line above to use that? Or some other way of telling EE to find the current url.
I think you might be able to write an extension to do this. EE keeps a history of recent url’s attached to the user’s session, although there is a chance this information gets cleared as part of the logout process.
$recent_url = $this->EE->functions->fetch_site_index(1).$this->EE->session->tracker['1'];By adjusting the ‘1’ parameter in the session tracker array, you can step forward and backward in the history.
It seems like {exp:member:member_logout} could conceivably support a return parameter (it currently does not), something like this:
{exp:member:member_logout return='http://your.return.address/'}Hope this helps.
-Matt
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.