X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FcreateAndPromote.php;h=1872716fb5c4eef67624b3e8cbcc9126134f7f76;hb=45b00db7330f12180f4b3cd9ba1404a710ee75b6;hp=848c2f7eda0654ccd4684bb41b8260dd74c4fa89;hpb=2f885ee6b797e5a176ce7b270b674a04b5945b06;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();