mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-30 17:54:24 +00:00
Merge "Do not record failures for non-existent accounts"
This commit is contained in:
commit
deef3ee3cd
|
@ -738,6 +738,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