Jump to content

Sign out redirection


CA3LE
 Share

Recommended Posts

Instead of redirecting to the page the sign out was initiated from it now goes to the board index.  How can I get back to the previous behavior.  For specific application needs, I need it to forward back to the page the user clicked "sign out" on.  Sign in redirection works great.  Forwards right back to my application like I need it to but since the upgrade from 4.0 to 4.1.1 sign out goes to the back to the index.

 

Link to comment
Share on other sites

Okay, guess I have to do it myself.

Here's how to fix that for anyone searching.  Unfortunately had to dig into the code. 

/public_html/ipb/applications/core/modules/front/system/login.php

comment out line 209 (as of 4.1.2)
//$redirectUrl = ( $referrer->isInternal and isset( $referrer->queryString['do'] ) and $referrer->queryString['do'] != 'validating' ) ? $referrer : \IPS\Http\Url::internal('');

Add the following line from version 4.0
$redirectUrl	= ( !empty( $_SERVER['HTTP_REFERER'] ) ) ? \IPS\Http\Url::external( $_SERVER['HTTP_REFERER'] ) : \IPS\Http\Url::internal( '' );

I also didn't like the added query string... 

\IPS\Output::i()->redirect( \IPS\Login::getDestination()->setQueryString( '_fromLogin', 1 ) );
change to 
\IPS\Output::i()->redirect( \IPS\Login::getDestination() );

\IPS\Output::i()->redirect( $redirectUrl->setQueryString( '_fromLogout', 1 ) );
change to
\IPS\Output::i()->redirect( $redirectUrl );

... fixed.

For some reason it always forwards to my board index without this modification to the code.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...