Index: trunk/phase3/CREDITS |
— | — | @@ -131,6 +131,7 @@ |
132 | 132 | * Michael Dale |
133 | 133 | * Michael De La Rue |
134 | 134 | * Michael M. |
| 135 | +* Michael Newton |
135 | 136 | * Michael Walsh |
136 | 137 | * Mike Horvath |
137 | 138 | * Mormegil |
Index: trunk/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -475,6 +475,7 @@ |
476 | 476 | $this->load(); |
477 | 477 | |
478 | 478 | if ( $this->mUsername == '' ) { |
| 479 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NO_NAME ) ); |
479 | 480 | return self::NO_NAME; |
480 | 481 | } |
481 | 482 | |
— | — | @@ -486,20 +487,24 @@ |
487 | 488 | // If the user doesn't have a login token yet, set one. |
488 | 489 | if ( !self::getLoginToken() ) { |
489 | 490 | self::setLoginToken(); |
| 491 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NEED_TOKEN ) ); |
490 | 492 | return self::NEED_TOKEN; |
491 | 493 | } |
492 | 494 | // If the user didn't pass a login token, tell them we need one |
493 | 495 | if ( !$this->mToken ) { |
| 496 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::NEED_TOKEN ) ); |
494 | 497 | return self::NEED_TOKEN; |
495 | 498 | } |
496 | 499 | |
497 | 500 | $throttleCount = self::incLoginThrottle( $this->mUsername ); |
498 | 501 | if ( $throttleCount === true ) { |
| 502 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::THROTTLED ) ); |
499 | 503 | return self::THROTTLED; |
500 | 504 | } |
501 | 505 | |
502 | 506 | // Validate the login token |
503 | 507 | if ( $this->mToken !== self::getLoginToken() ) { |
| 508 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::WRONG_TOKEN ) ); |
504 | 509 | return self::WRONG_TOKEN; |
505 | 510 | } |
506 | 511 | |
— | — | @@ -520,6 +525,7 @@ |
521 | 526 | # user choose a different wiki name. |
522 | 527 | $u = User::newFromName( $this->mUsername ); |
523 | 528 | if( !( $u instanceof User ) || !User::isUsableName( $u->getName() ) ) { |
| 529 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, self::ILLEGAL ) ); |
524 | 530 | return self::ILLEGAL; |
525 | 531 | } |
526 | 532 | |
— | — | @@ -527,6 +533,7 @@ |
528 | 534 | if ( 0 == $u->getID() ) { |
529 | 535 | $status = $this->attemptAutoCreate( $u ); |
530 | 536 | if ( $status !== self::SUCCESS ) { |
| 537 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $status ) ); |
531 | 538 | return $status; |
532 | 539 | } else { |
533 | 540 | $isAutoCreated = true; |
— | — | @@ -547,6 +554,7 @@ |
548 | 555 | // Give general extensions, such as a captcha, a chance to abort logins |
549 | 556 | $abort = self::ABORTED; |
550 | 557 | if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword, &$abort, &$this->mAbortLoginErrorMsg ) ) ) { |
| 558 | + wfRunHooks( 'LoginAuthenticateAudit', array( $u, $this->mPassword, $abort ) ); |
551 | 559 | return $abort; |
552 | 560 | } |
553 | 561 | |