jenkins-bot has submitted this change and it was merged.

Change subject: resetUserEmail: Allow resetting email without scrambling 
password
......................................................................


resetUserEmail: Allow resetting email without scrambling password

There is an mini-script in MediaWiki-Vagrant (set_user_email.erb)
that could be replaced by this.

Change-Id: Ieb0da6cc358506174f1ff01116d0b286f814b2c7
---
M maintenance/resetUserEmail.php
1 file changed, 8 insertions(+), 2 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/maintenance/resetUserEmail.php b/maintenance/resetUserEmail.php
index 816e8a4..8d0873f 100644
--- a/maintenance/resetUserEmail.php
+++ b/maintenance/resetUserEmail.php
@@ -34,6 +34,9 @@
                $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 @@
                $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 ) );
+               }
        }
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/271463
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ieb0da6cc358506174f1ff01116d0b286f814b2c7
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Mattflaschen <[email protected]>
Gerrit-Reviewer: Ori.livneh <[email protected]>
Gerrit-Reviewer: Parent5446 <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to