X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=1872716fb5c4eef67624b3e8cbcc9126134f7f76;hb=942446575486057b38e186a8f5599a645758b702;hp=848c2f7eda0654ccd4684bb41b8260dd74c4fa89;hpb=fc1ca75323b5f424a9f8d28d42d85a311ed2f721;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/createAndPromote.php b/maintenance/createAndPromote.php index 848c2f7eda..1872716fb5 100644 --- a/maintenance/createAndPromote.php +++ b/maintenance/createAndPromote.php @@ -120,7 +120,14 @@ class CreateAndPromote extends Maintenance { if ( $password ) { # Try to set the password try { - $user->setPassword( $password ); + $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" ); $user->saveSettings();