https://www.mediawiki.org/wiki/Special:Code/MediaWiki/113103
Revision: 113103
Author: reedy
Date: 2012-03-05 23:05:52 +0000 (Mon, 05 Mar 2012)
Log Message:
-----------
Normalise method returns, and returned value usage
Documentation fixes
Modified Paths:
--------------
trunk/phase3/includes/specials/SpecialUserlogin.php
Modified: trunk/phase3/includes/specials/SpecialUserlogin.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUserlogin.php 2012-03-05 23:04:24 UTC
(rev 113102)
+++ trunk/phase3/includes/specials/SpecialUserlogin.php 2012-03-05 23:05:52 UTC
(rev 113103)
@@ -167,11 +167,14 @@
return;
} elseif( $this->mPosted ) {
if( $this->mCreateaccount ) {
- return $this->addNewAccount();
+ $this->addNewAccount();
+ return;
} elseif ( $this->mCreateaccountMail ) {
- return $this->addNewAccountMailPassword();
+ $this->addNewAccountMailPassword();
+ return;
} elseif ( ( 'submitlogin' == $this->mAction ) ||
$this->mLoginattempt ) {
- return $this->processLogin();
+ $this->processLogin();
+ return;
}
}
$this->mainLoginForm( '' );
@@ -213,7 +216,7 @@
/**
* @private
- * @return bool|void
+ * @return bool
*/
function addNewAccount() {
global $wgUser, $wgEmailAuthentication,
$wgLoginLanguageSelector;
@@ -221,7 +224,7 @@
# Create the account and abort if there's a problem doing so
$u = $this->addNewAccountInternal();
if( $u == null ) {
- return;
+ return false;
}
# If we showed up language selection links, and one was in use,
be
@@ -258,9 +261,9 @@
wfRunHooks( 'AddNewAccount', array( $u, false ) );
$u->addNewUserLogEntry();
if( $this->hasSessionCookie() ) {
- return $this->successfulCreation();
+ $this->successfulCreation();
} else {
- return $this->cookieRedirectCheck( 'new' );
+ $this->cookieRedirectCheck( 'new' );
}
} else {
# Confirm that the account was created
@@ -269,8 +272,8 @@
$out->returnToMain( false, $this->getTitle() );
wfRunHooks( 'AddNewAccount', array( $u, false ) );
$u->addNewUserLogEntry( false, $this->mReason );
- return true;
}
+ return true;
}
/**
@@ -746,9 +749,9 @@
$userLang = Language::factory( $code );
$wgLang = $userLang;
$this->getContext()->setLanguage(
$userLang );
- return $this->successfulLogin();
+ $this->successfulLogin();
} else {
- return $this->cookieRedirectCheck(
'login' );
+ $this->cookieRedirectCheck( 'login' );
}
break;
@@ -768,7 +771,7 @@
case self::NOT_EXISTS:
if( $this->getUser()->isAllowed(
'createaccount' ) ) {
$this->mainLoginForm( $this->msg(
'nosuchuser',
- wfEscapeWikiText( $this->mUsername )
)->parse() );
+ wfEscapeWikiText(
$this->mUsername ) )->parse() );
} else {
$this->mainLoginForm( $this->msg(
'nosuchusershort',
wfEscapeWikiText(
$this->mUsername ) )->text() );
@@ -899,6 +902,8 @@
/**
* Display a "login successful" page.
+ * @param $msgname string
+ * @param $injected_html string
*/
private function displaySuccessfulLogin( $msgname, $injected_html ) {
$out = $this->getOutput();
@@ -1185,7 +1190,6 @@
/**
* @private
- * @return void
*/
function cookieRedirectCheck( $type ) {
$titleObj = SpecialPage::getTitleFor( 'Userlogin' );
@@ -1195,7 +1199,7 @@
}
$check = $titleObj->getFullURL( $query );
- return $this->getOutput()->redirect( $check );
+ $this->getOutput()->redirect( $check );
}
/**
@@ -1204,15 +1208,15 @@
function onCookieRedirectCheck( $type ) {
if ( !$this->hasSessionCookie() ) {
if ( $type == 'new' ) {
- return $this->mainLoginForm( $this->msg(
'nocookiesnew' )->parse() );
+ $this->mainLoginForm( $this->msg(
'nocookiesnew' )->parse() );
} elseif ( $type == 'login' ) {
- return $this->mainLoginForm( $this->msg(
'nocookieslogin' )->parse() );
+ $this->mainLoginForm( $this->msg(
'nocookieslogin' )->parse() );
} else {
# shouldn't happen
- return $this->mainLoginForm( $this->msg(
'error' )->text() );
+ $this->mainLoginForm( $this->msg( 'error'
)->text() );
}
} else {
- return $this->successfulLogin();
+ $this->successfulLogin();
}
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs