From 98b1fe07c65339ce8fe92659b8a4aee92a0e1e22 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 17 Feb 2011 16:46:08 -0800 Subject: [PATCH] Blow user:site_owner cache when granting/revoking 'owner' role --- classes/Profile.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.5