X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FresetUserEmail.php;h=8d0873f1b508526a43423ebc09a8f338bd135cea;hb=1f2c768a9df46909932b44443f733d2185517435;hp=816e8a430bf8ff99ce7fb64d3defb9efe283eba0;hpb=7489189d7c13448114963520fb383cb2c7765b1e;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/resetUserEmail.php b/maintenance/resetUserEmail.php index 816e8a430b..8d0873f1b5 100644 --- a/maintenance/resetUserEmail.php +++ b/maintenance/resetUserEmail.php @@ -34,6 +34,9 @@ class ResetUserEmail extends Maintenance { $this->addDescription( "Resets a user's email" ); $this->addArg( 'user', 'Username or user ID, if starts with #', true ); $this->addArg( 'email', 'Email to assign' ); + + $this->addOption( 'no-reset-password', 'Don\'t reset the user\'s password', false, false ); + parent::__construct(); } @@ -57,8 +60,11 @@ class ResetUserEmail extends Maintenance { $user->setEmail( $email ); $user->setEmailAuthenticationTimestamp( wfTimestampNow() ); $user->saveSettings(); - // Kick whomever is currently controlling the account off - $user->setPassword( PasswordFactory::generateRandomPasswordString( 128 ) ); + + if ( !$this->hasOption( 'no-reset-password' ) ) { + // Kick whomever is currently controlling the account off + $user->setPassword( PasswordFactory::generateRandomPasswordString( 128 ) ); + } } }