Don't skip UserGetRights hook in addGroup/removeGroup
[lhc/web/wiklou.git] / includes / User.php
index 685fe96..f205371 100644 (file)
@@ -124,9 +124,12 @@ class User {
                'edit',
                'editinterface',
                'editprotected',
+               'editmyoptions',
+               'editmyprivateinfo',
                'editmyusercss',
                'editmyuserjs',
                'editmywatchlist',
+               'editsemiprotected',
                'editusercssjs', #deprecated
                'editusercss',
                'edituserjs',
@@ -167,6 +170,7 @@ class User {
                'upload_by_url',
                'userrights',
                'userrights-interwiki',
+               'viewmyprivateinfo',
                'viewmywatchlist',
                'writeapi',
        );
@@ -2708,7 +2712,11 @@ class User {
                // In case loadGroups was not called before, we now have the right twice.
                // Get rid of the duplicate.
                $this->mGroups = array_unique( $this->mGroups );
-               $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
+
+               // Refresh the groups caches, and clear the rights cache so it will be
+               // refreshed on the next call to $this->getRights().
+               $this->getEffectiveGroups( true );
+               $this->mRights = null;
 
                $this->invalidateCache();
        }
@@ -2738,7 +2746,11 @@ class User {
                }
                $this->loadGroups();
                $this->mGroups = array_diff( $this->mGroups, array( $group ) );
-               $this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
+
+               // Refresh the groups caches, and clear the rights cache so it will be
+               // refreshed on the next call to $this->getRights().
+               $this->getEffectiveGroups( true );
+               $this->mRights = null;
 
                $this->invalidateCache();
        }
@@ -3143,7 +3155,7 @@ class User {
                $this->clearCookie( 'forceHTTPS' );
 
                // Remember when user logged out, to prevent seeing cached pages
-               $this->setCookie( 'LoggedOut', wfTimestampNow(), time() + 86400 );
+               $this->setCookie( 'LoggedOut', time(), time() + 86400 );
        }
 
        /**