mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/LoginNotify
synced 2024-11-11 16:49:30 +00:00
Avoid use of deprecated User::idFromName
Use the User object directly Bug: T325687 Change-Id: Id719e33f860204f912429631b50391edce8e56ec
This commit is contained in:
parent
52af63ef7a
commit
f1610a37a1
|
@ -58,13 +58,12 @@ class LoginAttempt extends Maintenance {
|
|||
$wgRequest->setIP( $ip );
|
||||
$wgRequest->setHeader( 'User-Agent', $ua );
|
||||
|
||||
if ( !User::idFromName( $username ) ) {
|
||||
$user = User::newFromName( $username, 'usable' );
|
||||
if ( !$user || !$user->isRegistered() ) {
|
||||
$this->output( "User {$username} does not exist!\n" );
|
||||
return;
|
||||
}
|
||||
|
||||
$user = User::newFromName( $username, 'usable' );
|
||||
|
||||
for ( $i = 0; $i < $reps; $i++ ) {
|
||||
if ( $success ) {
|
||||
$res = AuthenticationResponse::newPass( $username );
|
||||
|
|
Loading…
Reference in a new issue