$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();
}
$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 ) );
+ }
}
}