Avoid use of deprecated User::idFromName

Use the User object directly

Bug: T325687
Change-Id: Id719e33f860204f912429631b50391edce8e56ec
This commit is contained in:
Umherirrender 2022-12-21 22:34:26 +01:00
parent 52af63ef7a
commit f1610a37a1

View file

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