]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Blow user:site_owner cache when granting/revoking 'owner' role
authorBrion Vibber <brion@pobox.com>
Fri, 18 Feb 2011 00:46:08 +0000 (16:46 -0800)
committerBrion Vibber <brion@pobox.com>
Fri, 18 Feb 2011 00:46:08 +0000 (16:46 -0800)
classes/Profile.php

index bdac3ba453aa6e09dfd1e247aff7b98b30a1ac71..fd41c6139aaf884d1daf1f63ed741b861c08355f 100644 (file)
@@ -752,6 +752,10 @@ class Profile extends Memcached_DataObject
                 throw new Exception("Can't save role '$name' for profile '{$this->id}'");
             }
 
+            if ($name == 'owner') {
+                User::blow('user:site_owner');
+            }
+
             Event::handle('EndGrantRole', array($this, $name));
         }
 
@@ -780,6 +784,10 @@ class Profile extends Memcached_DataObject
                 throw new Exception(sprintf(_('Cannot revoke role "%1$s" for user #%2$d; database error.'),$name, $this->id));
             }
 
+            if ($name == 'owner') {
+                User::blow('user:site_owner');
+            }
+
             Event::handle('EndRevokeRole', array($this, $name));
 
             return true;