Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
- index 07dec15..1d63842 100644
- --- a/CentralAuth.i18n.php
- +++ b/CentralAuth.i18n.php
- @@ -219,6 +219,7 @@ The passwords for local accounts created before the merge will revert to their p
- 'centralauth-globalrename-complete' => 'Global rename queued...',
- 'action-centralauth-globalrename' => 'globally rename a user',
- 'centralauth-globalrename-nonexistent' => 'Global account "<nowiki>$1</nowiki>" does not exist.',
- + 'centralauth-globalrename-in-progress' => 'There is already a global rename in progress for <nowiki>$1</nowiki>.',
- // List of global users
- 'globalusers' => 'Global user list',
- @@ -745,6 +746,7 @@ See also:
- 'centralauth-renameuser-globalrenameuser' => '{{Logentry}}
- * $4 - the new username',
- 'right-centralauth-globalrename' => '{{doc-right|centralauth-globalrename}}',
- + 'centralauth-globalrename-in-progress' => 'Error message shown when a global rename is already in progress on this username.',
- );
- /** Afrikaans (Afrikaans)
- diff --git a/LocalRenameUserJob.php b/LocalRenameUserJob.php
- index 7860654..d1d117d 100644
- --- a/LocalRenameUserJob.php
- +++ b/LocalRenameUserJob.php
- @@ -72,7 +72,9 @@ class CentralAuthLocalRenameUserJob extends Job {
- ),
- __METHOD__
- );
- - CentralAuthUser::getCentralDB()->unlock( "centralauth-globalrename:" . $this->params['to'], __METHOD__ );
- + $cdb = CentralAuthUser::getCentralDB();
- + $cdb->unlock( "centralauth-globalrename:" . $this->params['from'], __METHOD__ );
- + $cdb->unlock( "centralauth-globalrename:" . $this->params['to'], __METHOD__ );
- } else {
- $wgMemc->set( $wikiListKey, $wikiList );
- }
- diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
- index a289f23..c1edb7a 100644
- --- a/specials/SpecialCentralAuth.php
- +++ b/specials/SpecialCentralAuth.php
- @@ -233,14 +233,20 @@ class SpecialCentralAuth extends SpecialPage {
- return true;
- }
- + $cdb = CentralAuthUser::getCentralDB();
- + if ( !$cdb->lockIsFree( 'centralauth-globalrename:' . $currentName, __METHOD__ ) ) {
- + $this->showError( 'centralauth-globalrename-in-progress', $currentName );
- + return true;
- + }
- + $cdb->lock( "centralauth-globalrename:" . $currentName, __METHOD__ );
- + $cdb->lock( "centralauth-globalrename:" . $newName, __METHOD__ );
- +
- $startedLocked = $globalUser->isLocked();
- // Lock the user before we start changing anything.
- if ( !$startedLocked ) {
- $globalUser->adminLock();
- }
- - CentralAuthUser::getCentralDB()->lock( "centralauth-globalrename:" . $newName, __METHOD__ );
- -
- // Update the globaluser and localuser tables. The existing hooks should deal with globalnames/localnames...
- $tables = array( 'globaluser' => 'gu', 'localuser' => 'lu' );
- foreach ( $tables as $table => $prefix ) {
Advertisement
Add Comment
Please, Sign In to add comment