r55994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55993‎ | r55994 | r55995 >
Date:19:20, 7 September 2009
Author:happy-melon
Status:reverted (Comments)
Tags:
Comment:
Followup to r55990 - rename method to avoid PHP Strict warnings
Modified paths:
  • /trunk/phase3/includes/Login.php (modified) (history)
  • /trunk/phase3/includes/api/ApiLogin.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialCreateAccount.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiLogin.php
@@ -69,7 +69,7 @@
7070 }
7171
7272 $loginForm = new Login( $req );
73 - switch ( $authRes = $loginForm->login() ) {
 73+ switch ( $authRes = $loginForm->attemptLogin() ) {
7474 case Login::SUCCESS :
7575 global $wgUser, $wgCookiePrefix;
7676
Index: trunk/phase3/includes/Login.php
@@ -110,7 +110,7 @@
111111 return $this->mUser;
112112 }
113113
114 - public function login(){
 114+ public function attemptLogin(){
115115 global $wgUser;
116116 $code = $this->authenticateUserData();
117117 if( !$code == self::SUCCESS ){
Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -415,7 +415,7 @@
416416
417417 protected function processLogin(){
418418 global $wgUser, $wgAuth;
419 - $result = $this->mLogin->login();
 419+ $result = $this->mLogin->attemptLogin();
420420 switch ( $result ) {
421421 case Login::SUCCESS:
422422 if( $this->hasSessionCookie() || $this->mSkipCookieCheck ) {
Index: trunk/phase3/includes/specials/SpecialCreateAccount.php
@@ -195,7 +195,7 @@
196196 $this->showMainForm( wfMsg( 'mailerror' ) );
197197 }
198198 } else {
199 - $wgOut->addWikiMsg( 'accmailtext', $this->mLogin->mUserer->getName(), $this->mLogin->mUser->getEmail() );
 199+ $wgOut->addWikiMsg( 'accmailtext', $this->mLogin->mUser->getName(), $this->mLogin->mUser->getEmail() );
200200 $wgOut->returnToMain( false );
201201 }
202202 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r56058Revert broken rewrite of login forms:...brion18:40, 8 September 2009

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r55990* Totally refactor includes/specials/SpecialUserlogin.php:...happy-melon19:00, 7 September 2009

Comments

#Comment by Nikerabbit (talk | contribs)   09:39, 8 September 2009

PHP Fatal error: Call to undefined method LoginForm::login() in /var/www/w/includes/specials/SpecialResetpass.php on line 54

#Comment by Happy-melon (talk | contribs)   10:07, 8 September 2009

WTF? I grepped for "->login(" over the whole trunk... :-(

#Comment by Happy-melon (talk | contribs)   10:15, 8 September 2009

Fixed in r56022.

#Comment by Brion VIBBER (talk | contribs)   17:31, 8 September 2009

I assume this is because the class name is also 'Login' so Login::login() is supposed to be an old-style constructor.

Status & tagging log