Revert r87292
authorSam Reed <reedy@users.mediawiki.org>
Tue, 7 Jun 2011 21:28:47 +0000 (21:28 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Tue, 7 Jun 2011 21:28:47 +0000 (21:28 +0000)
includes/User.php
includes/specials/SpecialUserlogin.php
includes/specials/SpecialUserrights.php

index 0ce2866..1ebc3a4 100644 (file)
@@ -1743,7 +1743,7 @@ class User {
                        $wgMemc->set( $key, $val ? 1 : 0, 1800 );
                }
                if ( $changed ) {
                        $wgMemc->set( $key, $val ? 1 : 0, 1800 );
                }
                if ( $changed ) {
-                       $this->invalidateCache( true );
+                       $this->invalidateCache();
                }
        }
 
                }
        }
 
@@ -1776,15 +1776,13 @@ class User {
         * Immediately touch the user data cache for this account.
         * Updates user_touched field, and removes account data from memcached
         * for reload on the next hit.
         * Immediately touch the user data cache for this account.
         * Updates user_touched field, and removes account data from memcached
         * for reload on the next hit.
-        *
-        * @param $doDatabaseUpdate bool Do you really need to update the database? Really?
         */
         */
-       function invalidateCache( $doDatabaseUpdate = false ) {
+       function invalidateCache() {
                if( wfReadOnly() ) {
                        return;
                }
                $this->load();
                if( wfReadOnly() ) {
                        return;
                }
                $this->load();
-               if( $this->mId && $doDatabaseUpdate ) {
+               if( $this->mId ) {
                        $this->mTouched = self::newTouchedTimestamp();
 
                        $dbw = wfGetDB( DB_MASTER );
                        $this->mTouched = self::newTouchedTimestamp();
 
                        $dbw = wfGetDB( DB_MASTER );
@@ -2247,7 +2245,7 @@ class User {
                $this->mGroups[] = $group;
                $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
 
                $this->mGroups[] = $group;
                $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
 
-               $this->invalidateCache( true );
+               $this->invalidateCache();
        }
 
        /**
        }
 
        /**
@@ -2269,7 +2267,7 @@ class User {
                $this->mGroups = array_diff( $this->mGroups, array( $group ) );
                $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
 
                $this->mGroups = array_diff( $this->mGroups, array( $group ) );
                $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
 
-               $this->invalidateCache( true );
+               $this->invalidateCache();
        }
 
        /**
        }
 
        /**
index cd22191..a96205a 100644 (file)
@@ -658,7 +658,7 @@ class LoginForm extends SpecialPage {
                                        $wgUser->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
                                        $wgUser->saveSettings();
                                } else {
                                        $wgUser->setOption( 'rememberpassword', $this->mRemember ? 1 : 0 );
                                        $wgUser->saveSettings();
                                } else {
-                                       $wgUser->invalidateCache( true );
+                                       $wgUser->invalidateCache();
                                }
                                $wgUser->setCookies();
                                self::clearLoginToken();
                                }
                                $wgUser->setCookies();
                                self::clearLoginToken();
index b4381da..41b1fb9 100644 (file)
@@ -231,7 +231,7 @@ class UserrightsPage extends SpecialPage {
                $newGroups = array_unique( $newGroups );
 
                // Ensure that caches are cleared
                $newGroups = array_unique( $newGroups );
 
                // Ensure that caches are cleared
-               $user->invalidateCache( true );
+               $user->invalidateCache();
 
                wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
                wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );
 
                wfDebug( 'oldGroups: ' . print_r( $oldGroups, true ) );
                wfDebug( 'newGroups: ' . print_r( $newGroups, true ) );