Merge "Re-introduce AvailableRightsTest for User::getAllRights completeness"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 16 Mar 2015 18:00:02 +0000 (18:00 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 16 Mar 2015 18:00:02 +0000 (18:00 +0000)
1  2 
includes/User.php

diff --combined includes/User.php
@@@ -1240,10 -1240,6 +1240,10 @@@ class User implements IDBAccessObject 
                        $all = false;
                }
  
 +              if ( isset( $row->user_id ) && isset( $row->user_name ) ) {
 +                      self::$idCacheByName[$row->user_name] = $row->user_id;
 +              }
 +
                if ( isset( $row->user_editcount ) ) {
                        $this->mEditCount = $row->user_editcount;
                } else {
                                        // Anon newtalk disabled by configuration.
                                        $this->mNewtalk = false;
                                } else {
 -                                      global $wgMemc;
 -                                      $key = wfMemcKey( 'newtalk', 'ip', $this->getName() );
 -                                      $newtalk = $wgMemc->get( $key );
 -                                      if ( strval( $newtalk ) !== '' ) {
 -                                              $this->mNewtalk = (bool)$newtalk;
 -                                      } else {
 -                                              // Since we are caching this, make sure it is up to date by getting it
 -                                              // from the master
 -                                              $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName(), true );
 -                                              $wgMemc->set( $key, (int)$this->mNewtalk, 1800 );
 -                                      }
 +                                      $this->mNewtalk = $this->checkNewtalk( 'user_ip', $this->getName() );
                                }
                        } else {
                                $this->mNewtalk = $this->checkNewtalk( 'user_id', $this->mId );
         * @param WebRequest|null $request WebRequest object to use; $wgRequest will be used if null
         *        is passed.
         */
 -      protected function setCookie( $name, $value, $exp = 0, $secure = null, $params = array(), $request = null ) {
 +      protected function setCookie(
 +              $name, $value, $exp = 0, $secure = null, $params = array(), $request = null
 +      ) {
                if ( $request === null ) {
                        $request = $this->getRequest();
                }
  
        /**
         * Get a list of all available permissions.
-        * @return array Array of permission names
+        * @return string[] Array of permission names
         */
        public static function getAllRights() {
                if ( self::$mAllRights === false ) {