mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-24 06:54:08 +00:00
Do not record failures for non-existent accounts
Change-Id: I2229f76aa6de0933cd11c6516f0486816f173533
This commit is contained in:
parent
c5d5020e6b
commit
a30621f412
|
@ -735,6 +735,16 @@ class LoginNotify implements LoggerAwareInterface {
|
|||
*/
|
||||
public function recordFailure( User $user ) {
|
||||
$this->incrStats( 'fail.total' );
|
||||
|
||||
if ( $user->isAnon() ) {
|
||||
// Login failed because user doesn't exist
|
||||
// skip this user.
|
||||
$this->log->debug( "Skipping recording failure for {user} - no account",
|
||||
[ 'user' => $user->getName() ]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
$known = $this->isKnownSystemFast( $user, $user->getRequest() );
|
||||
if ( $known === self::USER_KNOWN ) {
|
||||
$this->recordLoginFailureFromKnownSystem( $user );
|
||||
|
|
Loading…
Reference in a new issue