Merge "PHPUnit/Framework.php was removed in 2010"
[lhc/web/wiklou.git] / includes / User.php
index 3e49cd0..de34bfc 100644 (file)
@@ -1451,7 +1451,7 @@ class User {
                        // But this is a crappy hack and should die.
                        return false;
                }
-               return !$this->isAllowed('noratelimit');
+               return !$this->isAllowed( 'noratelimit' );
        }
 
        /**
@@ -2046,7 +2046,9 @@ class User {
        /**
         * Set the password and reset the random token unconditionally.
         *
-        * @param $str String New password to set
+        * @param $str string|null New password to set or null to set an invalid
+        *        password hash meaning that the user will not be able to log in
+        *        through the web interface.
         */
        public function setInternalPassword( $str ) {
                $this->load();
@@ -2284,7 +2286,7 @@ class User {
         * @return Int User's current value for the option
         * @see getOption()
         */
-       public function getIntOption( $oname, $defaultOverride=0 ) {
+       public function getIntOption( $oname, $defaultOverride = 0 ) {
                $val = $this->getOption( $oname );
                if( $val == '' ) {
                        $val = $defaultOverride;
@@ -2620,7 +2622,7 @@ class User {
                        if( $this->getId() ) {
                                $dbw->insert( 'user_groups',
                                        array(
-                                               'ug_user'  => $this->getID(),
+                                               'ug_user' => $this->getID(),
                                                'ug_group' => $group,
                                        ),
                                        __METHOD__,
@@ -2645,13 +2647,13 @@ class User {
                        $dbw = wfGetDB( DB_MASTER );
                        $dbw->delete( 'user_groups',
                                array(
-                                       'ug_user'  => $this->getID(),
+                                       'ug_user' => $this->getID(),
                                        'ug_group' => $group,
                                ), __METHOD__ );
                        // Remember that the user was in this group
                        $dbw->insert( 'user_former_groups',
                                array(
-                                       'ufg_user'  => $this->getID(),
+                                       'ufg_user' => $this->getID(),
                                        'ufg_group' => $group,
                                ),
                                __METHOD__,
@@ -2874,6 +2876,10 @@ class User {
         * the next change of any watched page.
         */
        public function clearAllNotifications() {
+               if ( wfReadOnly() ) {
+                       return;
+               }
+
                global $wgUseEnotif, $wgShowUpdatedMarker;
                if ( !$wgUseEnotif && !$wgShowUpdatedMarker ) {
                        $this->setNewtalk( false );
@@ -3264,7 +3270,7 @@ class User {
        public function getPageRenderingHash() {
                wfDeprecated( __METHOD__, '1.17' );
 
-               global $wgUseDynamicDates, $wgRenderHashAppend, $wgLang, $wgContLang;
+               global $wgRenderHashAppend, $wgLang, $wgContLang;
                if( $this->mHash ) {
                        return $this->mHash;
                }
@@ -3275,9 +3281,6 @@ class User {
 
                $confstr =        $this->getOption( 'math' );
                $confstr .= '!' . $this->getStubThreshold();
-               if ( $wgUseDynamicDates ) { # This is wrong (bug 24714)
-                       $confstr .= '!' . $this->getDatePreference();
-               }
                $confstr .= '!' . ( $this->getOption( 'numberheadings' ) ? '1' : '' );
                $confstr .= '!' . $wgLang->getCode();
                $confstr .= '!' . $this->getOption( 'thumbsize' );
@@ -4058,7 +4061,7 @@ class User {
                        $groups = array_merge_recursive(
                                $groups, $this->changeableByGroup( $addergroup )
                        );
-                       $groups['add']    = array_unique( $groups['add'] );
+                       $groups['add'] = array_unique( $groups['add'] );
                        $groups['remove'] = array_unique( $groups['remove'] );
                        $groups['add-self'] = array_unique( $groups['add-self'] );
                        $groups['remove-self'] = array_unique( $groups['remove-self'] );