From 162629f2144810633da76ad50bc7559b5faa9147 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 21 Aug 2015 09:53:33 +0000 Subject: [PATCH] authzgroups : clear the local cache when there is an update in the objects/members/rights to reload the informations from the database git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2266 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- authzgroups.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/authzgroups.php b/authzgroups.php index deb5466..74f1eb8 100644 --- a/authzgroups.php +++ b/authzgroups.php @@ -344,6 +344,7 @@ class authzgroups throw new Exception (dgettext ("domframework", "DB for Object is not connected"), 500); // TODO : Check parameters before saving them + $this->rightCache = null; return $this->dbObject->insert (array ("module"=>$module, "object"=>$object, "comment"=>$comment)); @@ -359,6 +360,7 @@ class authzgroups if (! isset ($idobjects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbObject->delete ($idobjects[0]["idobject"]); } @@ -372,6 +374,7 @@ class authzgroups if (! isset ($idobjects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbObject->delete ($idobjects[0]["idobject"]); } @@ -385,6 +388,7 @@ class authzgroups if (! isset ($idobjects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbObject->update ($idobjects[0]["idobject"], array ("object"=>$newobject, "comment"=>$newcomment)); @@ -401,6 +405,7 @@ class authzgroups if (! isset ($idobjects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbObject->update ($idobjects[0]["idobject"], array ("object"=>$newobject, "comment"=>$newcomment)); @@ -568,6 +573,7 @@ class authzgroups if (! isset ($groups[0]["idgroup"])) throw new Exception (dgettext ("domframework", "Wanted group not found"), 404); + $this->rightCache = null; return $this->dbGroupMember->insert (array ( "user"=>$user, "idgroup"=>$groups[0]["idgroup"], @@ -591,6 +597,7 @@ class authzgroups if (! isset ($groupsMembers[0]["idgroupmember"])) throw new Exception (dgettext ("domframework", "Wanted GroupMember not found"), 404); + $this->rightCache = null; return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]); } @@ -611,12 +618,14 @@ class authzgroups if (! isset ($groupsMembers[0]["idgroupmember"])) throw new Exception (dgettext ("domframework", "Wanted GroupMember not found"), 404); + $this->rightCache = null; return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]); } /** Update an groupmember in the database */ public function groupmemberUpdate ($module, $group, $user, $comment="") { + $this->rightCache = null; die ("This function is not available : contact us if you need it\n"); } @@ -628,6 +637,7 @@ class authzgroups if (count ($datas) === 0) throw new Exception (dgettext ("domframework", "IDUser in IDGroup not found"), 404); + $this->rightCache = null; return $this->dbGroupMember->update ($iduser, array ("user"=>$user, "comment"=>$comment)); @@ -748,6 +758,7 @@ class authzgroups if (! isset ($objects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"], "idobject"=>$objects[0]["idobject"], "right"=>$right, @@ -778,6 +789,7 @@ class authzgroups if (! isset ($objects[0]["idobject"])) throw new Exception (dgettext ("domframework", "Wanted object not found"), 404); + $this->rightCache = null; return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"], "idobject"=>$objects[0]["idobject"], "right"=>$right, @@ -795,6 +807,7 @@ class authzgroups if (!isset ($idrights[0]["idright"])) throw new Exception (dgettext ("domframework", "Wanted right not found"), 404); + $this->rightCache = null; return $this->dbRight->delete ($idrights[0]["idright"]); } @@ -808,6 +821,7 @@ class authzgroups if (!isset ($idrights[0]["idright"])) throw new Exception (dgettext ("domframework", "Wanted right not found"), 404); + $this->rightCache = null; return $this->dbRight->delete ($idrights[0]["idright"]); } @@ -831,6 +845,7 @@ class authzgroups if (!isset ($idrights[0]["idright"])) throw new Exception (dgettext ("domframework", "Wanted right not found"), 404); + $this->rightCache = null; return $this->dbRight->update ($idrights[0]["idright"], array ("right"=>$newright, "comment"=>$newcomment)); @@ -856,6 +871,7 @@ class authzgroups if (!isset ($idrights[0]["idright"])) throw new Exception (dgettext ("domframework", "Wanted right not found"), 404); + $this->rightCache = null; return $this->dbRight->update ($idrights[0]["idright"], array ("idobject"=>$newidobject, "right"=>$newright,