Merge "registration: Support 'namemsg'"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 7 Apr 2015 16:13:48 +0000 (16:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 Apr 2015 16:13:48 +0000 (16:13 +0000)
includes/User.php
languages/messages/MessagesBgn.php

index ecb31ba..4ada6b1 100644 (file)
@@ -452,7 +452,7 @@ class User implements IDBAccessObject {
                // The cache needs good consistency due to its high TTL, so the user
                // should have been loaded from the master to avoid lag amplification.
                if ( !( $this->queryFlagsUsed & self::READ_LATEST ) ) {
-                       wfWarn( "Cannot save slave-loaded User object data to cache." );
+                       wfWarn( "Cannot cache slave-loaded User object with ID '{$this->mId}'." );
                        return;
                }
 
@@ -3604,16 +3604,21 @@ class User implements IDBAccessObject {
                $this->load();
                $this->loadPasswords();
                if ( 0 == $this->mId ) {
-                       return;
+                       return; // anon
                }
 
                // This method is for updating existing users, so the user should
                // have been loaded from the master to begin with to avoid problems.
                if ( !( $this->queryFlagsUsed & self::READ_LATEST ) ) {
-                       wfWarn( "Attempting to save slave-loaded User object data." );
+                       wfWarn( "Attempting to save slave-loaded User object with ID '{$this->mId}'." );
                }
 
+               // Get a new user_touched that is higher than the old one.
+               // This will be used for a CAS check as a last-resort safety
+               // check against race conditions and slave lag.
+               $oldTouched = $this->mTouched;
                $this->mTouched = $this->newTouchedTimestamp();
+
                if ( !$wgAuth->allowSetLocalPassword() ) {
                        $this->mPassword = self::getPasswordFactory()->newFromCiphertext( null );
                }
@@ -3634,10 +3639,22 @@ class User implements IDBAccessObject {
                                'user_email_token_expires' => $dbw->timestampOrNull( $this->mEmailTokenExpires ),
                                'user_password_expires' => $dbw->timestampOrNull( $this->mPasswordExpires ),
                        ), array( /* WHERE */
-                               'user_id' => $this->mId
+                               'user_id' => $this->mId,
+                               'user_touched' => $dbw->timestamp( $oldTouched ) // CAS check
                        ), __METHOD__
                );
 
+               if ( !$dbw->affectedRows() ) {
+                       // User was changed in the meantime or loaded with stale data
+                       MWExceptionHandler::logException( new MWException(
+                               "CAS update failed on user_touched for user ID '{$this->mId}'."
+                       ) );
+                       // Maybe the problem was a missed cache update; clear it to be safe
+                       $this->clearSharedCache();
+
+                       return;
+               }
+
                $this->saveOptions();
 
                Hooks::run( 'UserSaveSettings', array( $this ) );
index 3d0aafc..98c2ba3 100644 (file)
@@ -1,11 +1,13 @@
 <?php
-/** Western Balochi
+/** Western Balochi (بلوچی رخشانی)
  *
  * To improve a translation please visit https://translatewiki.net
  *
  * @ingroup Language
  * @file
  *
+ * @author Ibrahim khashrowdi
+ * @author Mjbmr
  */
 
 $fallback = 'fa';
@@ -29,3 +31,28 @@ $namespaceNames = array(
        NS_CATEGORY         => 'تهر',
        NS_CATEGORY_TALK    => 'تهر_ئی_گپ',
 );
+
+$specialPageAliases = array(
+       'Activeusers'               => array( 'پئالین_کارمرزوکان' ),
+       'Allmessages'               => array( 'موچین_پیامان' ),
+       'AllMyUploads'              => array( 'ني_موچین_ایرگیج_ئآن', 'ني_موچین_وّرک_ئآن' ),
+       'Allpages'                  => array( 'موچین_تاکدیمان' ),
+       'ApiHelp'                   => array( 'ای_پی_آی_کومک' ),
+       'Ancientpages'              => array( 'کوهنگین_تاکدیمان' ),
+       'Badtitle'                  => array( 'خرابین_ئینوان' ),
+       'Blankpage'                 => array( 'خالین_دیم' ),
+       'Block'                     => array( 'بستین', 'آی_پی_بستین', 'کارمرزوکی_بستین' ),
+       'Booksources'               => array( 'کتاب_ئی_بُن' ),
+       'BrokenRedirects'           => array( 'خرابین_تغیرمسیر' ),
+       'Categories'                => array( 'تهرئان' ),
+       'ChangeEmail'               => array( 'ایمیل_ئی_گردینتین' ),
+       'ChangePassword'            => array( 'چیهرگال_ئی_پاک_کورتین', 'چیهرگال_ئی_ٹگل' ),
+       'ComparePages'              => array( 'تاکدیمانی_موقایسه_کورتین' ),
+       'Confirmemail'              => array( 'ایمیل_ئی_تائید_کورتین' ),
+       'Contributions'             => array( 'شراکت_ئان' ),
+       'CreateAccount'             => array( 'کارمرزوکین_هیساب_ئی_جۆڑ_کورتین' ),
+       'Deadendpages'              => array( 'بن_بست_ئین_تاکدیمان' ),
+       'DeletedContributions'      => array( 'پاک_بوته_ئین_شراکت_ئان' ),
+       'Diff'                      => array( 'پرک' ),
+       'DoubleRedirects'           => array( 'دوئین_تغیرمسیرئان' ),
+);