SHARE
    TWEET
    Krenair

    CA global renaming changes

    Jan 31st, 2013
    160
    0
    Never
    Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
    Diff 2.52 KB | None | 0 0
    1. diff --git a/CentralAuth.i18n.php b/CentralAuth.i18n.php
    2. index 07dec15..1d63842 100644
    3. --- a/CentralAuth.i18n.php
    4. +++ b/CentralAuth.i18n.php
    5. @@ -219,6 +219,7 @@ The passwords for local accounts created before the merge will revert to their p
    6. 'centralauth-globalrename-complete' => 'Global rename queued...',
    7. 'action-centralauth-globalrename' => 'globally rename a user',
    8. 'centralauth-globalrename-nonexistent' => 'Global account "<nowiki>1ドル</nowiki>" does not exist.',
    9. + 'centralauth-globalrename-in-progress' => 'There is already a global rename in progress for <nowiki>1ドル</nowiki>.',
    10. // List of global users
    11. 'globalusers' => 'Global user list',
    12. @@ -745,6 +746,7 @@ See also:
    13. 'centralauth-renameuser-globalrenameuser' => '{{Logentry}}
    14. * 4ドル - the new username',
    15. 'right-centralauth-globalrename' => '{{doc-right|centralauth-globalrename}}',
    16. + 'centralauth-globalrename-in-progress' => 'Error message shown when a global rename is already in progress on this username.',
    17. );
    18. /** Afrikaans (Afrikaans)
    19. diff --git a/specials/SpecialCentralAuth.php b/specials/SpecialCentralAuth.php
    20. index a289f23..91b4354 100644
    21. --- a/specials/SpecialCentralAuth.php
    22. +++ b/specials/SpecialCentralAuth.php
    23. @@ -233,14 +233,19 @@ class SpecialCentralAuth extends SpecialPage {
    24. return true;
    25. }
    26. + $cdb = CentralAuthUser::getCentralDB();
    27. + if ( !$cdb->lockIsFree( 'centralauth-globalrename:' . $newName, __METHOD__ ) ) {
    28. + $this->showError( 'centralauth-globalrename-in-progress', $currentName );
    29. + return true;
    30. + }
    31. + $cdb->lock( "centralauth-globalrename:" . $newName, __METHOD__ );
    32. +
    33. $startedLocked = $globalUser->isLocked();
    34. // Lock the user before we start changing anything.
    35. if ( !$startedLocked ) {
    36. $globalUser->adminLock();
    37. }
    38. - CentralAuthUser::getCentralDB()->lock( "centralauth-globalrename:" . $newName, __METHOD__ );
    39. -
    40. // Update the globaluser and localuser tables. The existing hooks should deal with globalnames/localnames...
    41. $tables = array( 'globaluser' => 'gu', 'localuser' => 'lu' );
    42. foreach ( $tables as $table => $prefix ) {
    Advertisement
    Add Comment
    Please, Sign In to add comment
    Public Pastes
    We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
    Not a member of Pastebin yet?
    Sign Up, it unlocks many cool features!

    AltStyle によって変換されたページ (->オリジナル) /