Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted October 30, 20159 yr 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.
October 31, 20159 yr Author Anyone have a clue what I'm talking about? Are there any options for the way the sign out redirection works?
November 1, 20159 yr 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.
November 2, 20159 yr Author Sweet, posted this to the bug tracker and it's been marked fixed as of the next release, 4.1.3. Thanks IPS!
Archived
This topic is now archived and is closed to further replies.