r103418 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103417‎ | r103418 | r103419 >
Date:23:55, 16 November 2011
Author:bawolff
Status:ok
Tags:
Comment:
revert r103396 (breaks unit tests) - In lots of these places $u is undefined (for example, of a user doesn't specify a name, we havn't created a user object yet at the time of that check). Probably need to do something like create a second hook for loginAuditUserTotallyFailed or something.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUserlogin.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUserlogin.php
@@ -475,7 +475,6 @@
476476 $this->load();
477477
478478 if ( $this->mUsername == '' ) {
479 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NO_NAME ) );
480479 return self::NO_NAME;
481480 }
482481
@@ -487,24 +486,20 @@
488487 // If the user doesn't have a login token yet, set one.
489488 if ( !self::getLoginToken() ) {
490489 self::setLoginToken();
491 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NEED_TOKEN ) );
492490 return self::NEED_TOKEN;
493491 }
494492 // If the user didn't pass a login token, tell them we need one
495493 if ( !$this->mToken ) {
496 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NEED_TOKEN ) );
497494 return self::NEED_TOKEN;
498495 }
499496
500497 $throttleCount = self::incLoginThrottle( $this->mUsername );
501498 if ( $throttleCount === true ) {
502 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::THROTTLED ) );
503499 return self::THROTTLED;
504500 }
505501
506502 // Validate the login token
507503 if ( $this->mToken !== self::getLoginToken() ) {
508 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::WRONG_TOKEN ) );
509504 return self::WRONG_TOKEN;
510505 }
511506
@@ -525,7 +520,6 @@
526521 # user choose a different wiki name.
527522 $u = User::newFromName( $this->mUsername );
528523 if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) {
529 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::ILLEGAL ) );
530524 return self::ILLEGAL;
531525 }
532526
@@ -533,7 +527,6 @@
534528 if ( 0 == $u->getID() ) {
535529 $status = $this->attemptAutoCreate( $u );
536530 if ( $status !== self::SUCCESS ) {
537 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $status ) );
538531 return $status;
539532 } else {
540533 $isAutoCreated = true;
@@ -554,7 +547,6 @@
555548 // Give general extensions, such as a captcha, a chance to abort logins
556549 $abort = self::ABORTED;
557550 if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$this->mAbortLoginErrorMsg ) ) ) {
558 - wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $abort ) );
559551 return $abort;
560552 }
561553

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103396Applying Michael Newton's patch from Bug 24464 - Execute...mah22:24, 16 November 2011

Status & tagging log