We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

modify a module to utilize code igniter code

Development and Programming

heaversm's avatar
heaversm
197 posts
about 15 years ago
heaversm's avatar heaversm

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.

       
Matt Gilg's avatar
Matt Gilg
6 posts
about 15 years ago
Matt Gilg's avatar Matt Gilg

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

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.