Wikia code/includes/specials/SpecialUserlogout.php
Appearance
This page is obsolete. It is being retained for archival purposes. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. The information shown below refers to the now unmaintained 1.16 MediaWiki release. The current stable release number is 1.42.3. |
--- D:\Programming\SVN\mediawiki\branches\REL1_16\phase3\includes\specials\SpecialUserlogout.php 2011-07-18 22:31:17.708984400 +0100
+++ D:\Programming\SVN\wikia\trunk\includes\specials\SpecialUserlogout.php 2011-08-17 15:28:16.355468700 +0100
@@ -8,7 +8,7 @@
* constructor
*/
function wfSpecialUserlogout() {
- global $wgUser, $wgOut;
+ global $wgUser, $wgOut, $wgRequest;
/**
* Some satellite ISPs use broken precaching schemes that log people out straight after
@@ -29,5 +29,22 @@
wfRunHooks( 'UserLogoutComplete', array(&$wgUser, &$injected_html, $oldName) );
$wgOut->addHTML( wfMsgExt( 'logouttext', array( 'parse' ) ) . $injected_html );
- $wgOut->returnToMain();
+
+ $mReturnTo = $wgRequest->getVal( 'returnto' );
+ $mReturnToQuery = $wgRequest->getVal( 'returntoquery' );
+
+ $title = Title::newFromText($mReturnTo);
+ if (!empty($title))
+ {
+ $mResolvedReturnTo = strtolower(SpecialPage::resolveAlias($title->getDBKey()));
+ if(in_array($mResolvedReturnTo,array('userlogout','signup','connect')))
+ {
+ $titleObj = Title::newMainPage();
+ $mReturnTo = $titleObj->getText( );
+ $mReturnToQuery = '';
+ }
+ }
+
+
+ $wgOut->returnToMain(false, $mReturnTo, $mReturnToQuery);
}