Jump to content

Sign out redirection

Featured Replies

Posted

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.

 

  • Author

Anyone have a clue what I'm talking about?  Are there any options for the way the sign out redirection works?

  • Author

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.

  • Author

Sweet, posted this to the bug tracker and it's been marked fixed as of the next release, 4.1.3.  Thanks IPS!

563799bedacae_ScreenShot2015-11-02at10.1

Archived

This topic is now archived and is closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.