diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
index 1d63842..5b38d75 100644
--- a/CentralAuth.i18n.php
+++ b/CentralAuth.i18n.php
@@ -220,6 +220,7 @@ The passwords for local accounts created before the merge will revert to their p
'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>.',
+ 'centralauth-globalrename-tempdisallowed' => 'Global account "<nowiki>1ドル</nowiki>" has more than 2ドル edits. Globally renaming such accounts has been temporarily disallowed while the code is experime
// List of global users
'globalusers' => 'Global user list',
@@ -747,6 +748,7 @@ See also:
* 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.',
+ 'centralauth-globalrename-tempdisallowed' => 'Error message shown when trying to rename a user with too many edits (default: 5000). This limitation will hopefully go away when we\'re happy with the
);
/** Afrikaans (Afrikaans)
diff --git a/LocalRenameUserJob.php b/LocalRenameUserJob.php
index d1d117d..07fcd12 100644
--- a/LocalRenameUserJob.php
+++ b/LocalRenameUserJob.php
@@ -21,8 +21,8 @@ class CentralAuthLocalRenameUserJob extends Job {
);
if ( $rus->rename() ) {
- // TODO: For renames of more than RENAMEUSER_CONTRIBJOB (default: 5000), this might need to take place in CentralAuthHooks::onRenameUserComplete
- $wikiListKey = CentralAuthUser::memcKey( 'globalrename', sha1( $from ) );
+ // TODO: For renames of more than RENAMEUSER_CONTRIBJOB (default: 5000), we might want to do this in CentralAuthHooks::onRenameUserComplete instead
+ $wikiListKey = CentralAuthUser::memcKey( 'globalrename', sha1( $to ) );
$wikiList = $wgMemc->get( $wikiListKey ); // TODO: Find a way to completely disable global renaming if memcache isn't available on all wikis. We can't just quit here if we see that
$wikiList = array_diff( $wikiList, array( $wgDBname ) ); // Remove this wiki from the list.
if ( count( $wikiList ) == 0 ) {
diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
index c1edb7a..7fb17ba 100644
--- a/specials/SpecialCentralAuth.php
+++ b/specials/SpecialCentralAuth.php
@@ -25,7 +25,7 @@ class SpecialCentralAuth extends SpecialPage {
$this->mCanOversight = $this->getUser()->isAllowed( 'centralauth-oversight' );
$this->mCanEdit = $this->mCanUnmerge || $this->mCanLock || $this->mCanOversight;
AutoLoader::loadClass( 'SpecialRenameuser' );
- $this->mCanRename = $this->getUser()->isAllowed( 'centralauth-globalrename' ) && class_exists( 'SpecialRenameuser', false );
+ $this->mCanRename = $this->getUser()->isAllowed( 'centralauth-globalrename' ) && class_exists( 'RenameuserSQL', false ) && property_exists( 'RenameuserSQL', 'checkIfUserExists' );
$this->getOutput()->addModules( 'ext.centralauth' );
$this->getOutput()->addModuleStyles( 'ext.centralauth.noflash' );
$this->getOutput()->addJsConfigVars( 'wgMergeMethodDescriptions', $this->getMergeMethodDescriptions() );
@@ -217,6 +217,11 @@ class SpecialCentralAuth extends SpecialPage {
return true;
}
+ if ( $this->evaluateTotalEditcount() > RENAMEUSER_CONTRIBJOB ) {
+ $this->showError( 'centralauth-globalrename-tempdisallowed', $globalUser->getName(), RENAMEUSER_CONTRIBJOB );
+ return true;
+ }
+
$currentName = $globalUser->getName();
$newName = $this->getRequest()->getText( 'newname' );
@@ -276,7 +281,7 @@ class SpecialCentralAuth extends SpecialPage {
);
global $wgMemc;
- $wgMemc->set( CentralAuthUser::memcKey( 'globalrename', sha1( $currentName ) ), $globalUser->listAttached() );
+ $wgMemc->set( CentralAuthUser::memcKey( 'globalrename', sha1( $newName ) ), $globalUser->listAttached() );
// Put the job into the queue on each wiki it needs to run on
foreach ( $globalUser->listAttached() as $wiki ) {