X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=1872716fb5c4eef67624b3e8cbcc9126134f7f76;hb=f73a68e15cab42ad2e2772b0eea51d75b44ba321;hp=3591b9ce2456f0728c3c058571e88120c2b327d3;hpb=7586eef13a7da73401f1d200a3c99ea7c2ed1786;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 3591b9ce24..1872716fb5 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -56,8 +56,6 @@ class CreateAndPromote extends Maintenance { } public function execute() { - global $wgDisableAuthManager; - $username = $this->getArg( 0 ); $password = $this->getArg( 1 ); $force = $this->hasOption( 'force' ); @@ -122,17 +120,13 @@ class CreateAndPromote extends Maintenance { if ( $password ) { # Try to set the 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' ) ); } if ( $exists ) { $this->output( "Password set.\n" );