X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FchangePassword.php;h=9fa66324f5a1ef3f6a507f21fef7d159894e6de8;hb=e19f1c0bcf1ae80f776ae649fd2c06f89c6e4fbc;hp=a550d12777431c7d342d6ffde3bc277c03585289;hpb=d5ff621d43b195c41c141288fb8d2b05793b55f4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/changePassword.php b/maintenance/changePassword.php index a550d12777..9fa66324f5 100644 --- a/maintenance/changePassword.php +++ b/maintenance/changePassword.php @@ -41,8 +41,6 @@ class ChangePassword extends Maintenance { } public function execute() { - global $wgDisableAuthManager; - if ( $this->hasOption( "user" ) ) { $user = User::newFromName( $this->getOption( 'user' ) ); } elseif ( $this->hasOption( "userid" ) ) { @@ -55,17 +53,13 @@ class ChangePassword extends Maintenance { } $password = $this->getOption( 'password' ); try { - if ( $wgDisableAuthManager ) { - $user->setPassword( $password ); - } else { - $status = $user->changeAuthenticationData( [ - 'username' => $user->getName(), - 'password' => $password, - 'retype' => $password, - ] ); - if ( !$status->isGood() ) { - throw new PasswordError( $status->getWikiText( null, null, 'en' ) ); - } + $status = $user->changeAuthenticationData( [ + 'username' => $user->getName(), + 'password' => $password, + 'retype' => $password, + ] ); + if ( !$status->isGood() ) { + throw new PasswordError( $status->getWikiText( null, null, 'en' ) ); } $user->saveSettings(); $this->output( "Password set for " . $user->getName() . "\n" );