https://www.mediawiki.org/wiki/Special:Code/MediaWiki/103418
Revision: 103418
Author: bawolff
Date: 2011-11-16 23:55:40 +0000 (Wed, 16 Nov 2011)
Log Message:
-----------
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: trunk/phase3/includes/specials/SpecialUserlogin.php
===================================================================
--- trunk/phase3/includes/specials/SpecialUserlogin.php 2011-11-16 23:45:39 UTC
(rev 103417)
+++ trunk/phase3/includes/specials/SpecialUserlogin.php 2011-11-16 23:55:40 UTC
(rev 103418)
@@ -475,7 +475,6 @@
$this->load();
if ( $this->mUsername == '' ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::NO_NAME ) );
return self::NO_NAME;
}
@@ -487,24 +486,20 @@
// If the user doesn't have a login token yet, set one.
if ( !self::getLoginToken() ) {
self::setLoginToken();
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::NEED_TOKEN ) );
return self::NEED_TOKEN;
}
// If the user didn't pass a login token, tell them we need one
if ( !$this->mToken ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::NEED_TOKEN ) );
return self::NEED_TOKEN;
}
$throttleCount = self::incLoginThrottle( $this->mUsername );
if ( $throttleCount === true ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::THROTTLED ) );
return self::THROTTLED;
}
// Validate the login token
if ( $this->mToken !== self::getLoginToken() ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::WRONG_TOKEN ) );
return self::WRONG_TOKEN;
}
@@ -525,7 +520,6 @@
# user choose a different wiki name.
$u = User::newFromName( $this->mUsername );
if( !( $u instanceof User ) || !User::isUsableName(
$u->getName() ) ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, self::ILLEGAL ) );
return self::ILLEGAL;
}
@@ -533,7 +527,6 @@
if ( 0 == $u->getID() ) {
$status = $this->attemptAutoCreate( $u );
if ( $status !== self::SUCCESS ) {
- wfRunHooks( 'LoginAuthenticateAudit', array(
$u, $this->mPassword, $status ) );
return $status;
} else {
$isAutoCreated = true;
@@ -554,7 +547,6 @@
// Give general extensions, such as a captcha, a chance to
abort logins
$abort = self::ABORTED;
if( !wfRunHooks( 'AbortLogin', array( $u, $this->mPassword,
&$abort, &$this->mAbortLoginErrorMsg ) ) ) {
- wfRunHooks( 'LoginAuthenticateAudit', array( $u,
$this->mPassword, $abort ) );
return $abort;
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs