From: Brion Vibber Date: Fri, 18 Feb 2011 00:46:08 +0000 (-0800) Subject: Blow user:site_owner cache when granting/revoking 'owner' role X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=98b1fe07c65339ce8fe92659b8a4aee92a0e1e22;p=quix0rs-gnu-social.git Blow user:site_owner cache when granting/revoking 'owner' role --- diff --git a/classes/Profile.php b/classes/Profile.php index bdac3ba453..fd41c6139a 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -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;