Do not record failures for non-existent accounts

Change-Id: I2229f76aa6de0933cd11c6516f0486816f173533
This commit is contained in:
Brian Wolff 2017-08-23 20:58:13 +00:00 committed by MaxSem
parent c5d5020e6b
commit a30621f412

View file

@ -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 );