Nemo bis has uploaded a new change for review.

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

Change subject: migrateAccount.php: allow --attachmissing and --attachbroken 
together
......................................................................

migrateAccount.php: allow --attachmissing and --attachbroken together

No reason for the two to be mutually exclusive, a same list of
usernames can be used for both. Also, having a global account is
either expected or a normal step in the process, always tell as info.

Change-Id: I6a06d8a869c9b77260316f5397861d79b36f2d83
---
M maintenance/migrateAccount.php
1 file changed, 5 insertions(+), 3 deletions(-)


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

diff --git a/maintenance/migrateAccount.php b/maintenance/migrateAccount.php
index 48b101d..93cfe36 100644
--- a/maintenance/migrateAccount.php
+++ b/maintenance/migrateAccount.php
@@ -108,6 +108,8 @@
                 * Migration with an existing global account
                 */
                if ( $central->exists() ) {
+                       $this->output( "INFO: A global account already exists 
for: $username\n" );
+
                        if (
                                $this->getOption( 'attachmissing', false )
                                && !is_null( 
$central->getEmailAuthenticationTimestamp() )
@@ -121,7 +123,9 @@
                                                $central->attach( $wiki, 
'mail', /** $sendToRC = */ !$this->suppressRC );
                                        }
                                }
-                       } elseif ( $this->getOption( 'attachbroken', false ) ) {
+                       }
+
+                       if ( $this->getOption( 'attachbroken', false ) ) {
                                // This option is for bug 61876 / bug 39996 
where the account has
                                // an empty password and email set, and became 
unattached.
                                // Since there is no way an account can have an 
empty password manually
@@ -136,8 +140,6 @@
                                                $central->attach( $wiki, 
'password', /** $sendToRC = */ !$this->suppressRC );
                                        }
                                }
-                       } else {
-                               $this->output( "ERROR: A global account already 
exists for: $username\n" );
                        }
                }
                /**

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

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

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

Reply via email to