Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -167,11 +167,14 @@ |
168 | 168 | return; |
169 | 169 | } elseif( $this->mPosted ) { |
170 | 170 | if( $this->mCreateaccount ) { |
171 | | - return $this->addNewAccount(); |
| 171 | + $this->addNewAccount(); |
| 172 | + return; |
172 | 173 | } elseif ( $this->mCreateaccountMail ) { |
173 | | - return $this->addNewAccountMailPassword(); |
| 174 | + $this->addNewAccountMailPassword(); |
| 175 | + return; |
174 | 176 | } elseif ( ( 'submitlogin' == $this->mAction ) || $this->mLoginattempt ) { |
175 | | - return $this->processLogin(); |
| 177 | + $this->processLogin(); |
| 178 | + return; |
176 | 179 | } |
177 | 180 | } |
178 | 181 | $this->mainLoginForm( '' ); |
— | — | @@ -213,7 +216,7 @@ |
214 | 217 | |
215 | 218 | /** |
216 | 219 | * @private |
217 | | - * @return bool|void |
| 220 | + * @return bool |
218 | 221 | */ |
219 | 222 | function addNewAccount() { |
220 | 223 | global $wgUser, $wgEmailAuthentication, $wgLoginLanguageSelector; |
— | — | @@ -221,7 +224,7 @@ |
222 | 225 | # Create the account and abort if there's a problem doing so |
223 | 226 | $u = $this->addNewAccountInternal(); |
224 | 227 | if( $u == null ) { |
225 | | - return; |
| 228 | + return false; |
226 | 229 | } |
227 | 230 | |
228 | 231 | # If we showed up language selection links, and one was in use, be |
— | — | @@ -258,9 +261,9 @@ |
259 | 262 | wfRunHooks( 'AddNewAccount', array( $u, false ) ); |
260 | 263 | $u->addNewUserLogEntry(); |
261 | 264 | if( $this->hasSessionCookie() ) { |
262 | | - return $this->successfulCreation(); |
| 265 | + $this->successfulCreation(); |
263 | 266 | } else { |
264 | | - return $this->cookieRedirectCheck( 'new' ); |
| 267 | + $this->cookieRedirectCheck( 'new' ); |
265 | 268 | } |
266 | 269 | } else { |
267 | 270 | # Confirm that the account was created |
— | — | @@ -269,8 +272,8 @@ |
270 | 273 | $out->returnToMain( false, $this->getTitle() ); |
271 | 274 | wfRunHooks( 'AddNewAccount', array( $u, false ) ); |
272 | 275 | $u->addNewUserLogEntry( false, $this->mReason ); |
273 | | - return true; |
274 | 276 | } |
| 277 | + return true; |
275 | 278 | } |
276 | 279 | |
277 | 280 | /** |
— | — | @@ -746,9 +749,9 @@ |
747 | 750 | $userLang = Language::factory( $code ); |
748 | 751 | $wgLang = $userLang; |
749 | 752 | $this->getContext()->setLanguage( $userLang ); |
750 | | - return $this->successfulLogin(); |
| 753 | + $this->successfulLogin(); |
751 | 754 | } else { |
752 | | - return $this->cookieRedirectCheck( 'login' ); |
| 755 | + $this->cookieRedirectCheck( 'login' ); |
753 | 756 | } |
754 | 757 | break; |
755 | 758 | |
— | — | @@ -768,7 +771,7 @@ |
769 | 772 | case self::NOT_EXISTS: |
770 | 773 | if( $this->getUser()->isAllowed( 'createaccount' ) ) { |
771 | 774 | $this->mainLoginForm( $this->msg( 'nosuchuser', |
772 | | - wfEscapeWikiText( $this->mUsername ) )->parse() ); |
| 775 | + wfEscapeWikiText( $this->mUsername ) )->parse() ); |
773 | 776 | } else { |
774 | 777 | $this->mainLoginForm( $this->msg( 'nosuchusershort', |
775 | 778 | wfEscapeWikiText( $this->mUsername ) )->text() ); |
— | — | @@ -899,6 +902,8 @@ |
900 | 903 | |
901 | 904 | /** |
902 | 905 | * Display a "login successful" page. |
| 906 | + * @param $msgname string |
| 907 | + * @param $injected_html string |
903 | 908 | */ |
904 | 909 | private function displaySuccessfulLogin( $msgname, $injected_html ) { |
905 | 910 | $out = $this->getOutput(); |
— | — | @@ -1185,7 +1190,6 @@ |
1186 | 1191 | |
1187 | 1192 | /** |
1188 | 1193 | * @private |
1189 | | - * @return void |
1190 | 1194 | */ |
1191 | 1195 | function cookieRedirectCheck( $type ) { |
1192 | 1196 | $titleObj = SpecialPage::getTitleFor( 'Userlogin' ); |
— | — | @@ -1195,7 +1199,7 @@ |
1196 | 1200 | } |
1197 | 1201 | $check = $titleObj->getFullURL( $query ); |
1198 | 1202 | |
1199 | | - return $this->getOutput()->redirect( $check ); |
| 1203 | + $this->getOutput()->redirect( $check ); |
1200 | 1204 | } |
1201 | 1205 | |
1202 | 1206 | /** |
— | — | @@ -1204,15 +1208,15 @@ |
1205 | 1209 | function onCookieRedirectCheck( $type ) { |
1206 | 1210 | if ( !$this->hasSessionCookie() ) { |
1207 | 1211 | if ( $type == 'new' ) { |
1208 | | - return $this->mainLoginForm( $this->msg( 'nocookiesnew' )->parse() ); |
| 1212 | + $this->mainLoginForm( $this->msg( 'nocookiesnew' )->parse() ); |
1209 | 1213 | } elseif ( $type == 'login' ) { |
1210 | | - return $this->mainLoginForm( $this->msg( 'nocookieslogin' )->parse() ); |
| 1214 | + $this->mainLoginForm( $this->msg( 'nocookieslogin' )->parse() ); |
1211 | 1215 | } else { |
1212 | 1216 | # shouldn't happen |
1213 | | - return $this->mainLoginForm( $this->msg( 'error' )->text() ); |
| 1217 | + $this->mainLoginForm( $this->msg( 'error' )->text() ); |
1214 | 1218 | } |
1215 | 1219 | } else { |
1216 | | - return $this->successfulLogin(); |
| 1220 | + $this->successfulLogin(); |
1217 | 1221 | } |
1218 | 1222 | } |
1219 | 1223 | |