Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/183163

Change subject: sendConfirmAndMigrateEmail: Add --resume option
......................................................................

sendConfirmAndMigrateEmail: Add --resume option

Change-Id: I5cf525f2ef34517bb54bc436928c5ada0765503f
---
M maintenance/sendConfirmAndMigrateEmail.php
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/63/183163/1

diff --git a/maintenance/sendConfirmAndMigrateEmail.php 
b/maintenance/sendConfirmAndMigrateEmail.php
index 748917f..f6c9ea7 100644
--- a/maintenance/sendConfirmAndMigrateEmail.php
+++ b/maintenance/sendConfirmAndMigrateEmail.php
@@ -38,6 +38,11 @@
         */
        private $dryrun;
 
+       /**
+        * @var string|bool
+        */
+       private $resume;
+
        public function __construct() {
                parent::__construct();
                $this->mDescription = "Resends the 'confirm your email address 
email' with a link to Special:MergeAccount";
@@ -51,12 +56,14 @@
                $this->addOption( 'confirmed', 'Send email to confirmed 
accounts', false, false );
                $this->addOption( 'sleep', 'How long to wait in between 
emails', false, true );
                $this->addOption( 'dryrun', 'Don\'t actually send any emails', 
false, false );
+               $this->addOption( 'resume', 'Which username to resume from', 
false, true );
        }
 
        public function execute() {
                $this->sendToConfirmed = $this->getOption( 'confirmed', false );
                $this->sleep = $this->getOption( 'sleep', 1 );
                $this->dryrun = $this->hasOption( 'dryrun');
+               $this->resume = $this->getOption( 'resume', true );
 
                // check to see if we are processing a single username
                if ( $this->getOption( 'username', false ) !== false ) {
@@ -77,6 +84,10 @@
                        }
                        while( $username = fgets( $file ) ) {
                                $username = trim( $username ); // trim the \n
+                               if ( $this->resume !== true  ) {
+                                       $this->resume = $username === 
$this->resume;
+                                       continue;
+                               }
                                $this->resendConfirmationEmail( $username );
 
                                if ( $this->total % $this->batchSize == 0 ) {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cf525f2ef34517bb54bc436928c5ada0765503f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

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

Reply via email to