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
This commit is contained in:
@@ -344,6 +344,7 @@ class authzgroups
|
|||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"DB for Object is not connected"), 500);
|
"DB for Object is not connected"), 500);
|
||||||
// TODO : Check parameters before saving them
|
// TODO : Check parameters before saving them
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbObject->insert (array ("module"=>$module,
|
return $this->dbObject->insert (array ("module"=>$module,
|
||||||
"object"=>$object,
|
"object"=>$object,
|
||||||
"comment"=>$comment));
|
"comment"=>$comment));
|
||||||
@@ -359,6 +360,7 @@ class authzgroups
|
|||||||
if (! isset ($idobjects[0]["idobject"]))
|
if (! isset ($idobjects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbObject->delete ($idobjects[0]["idobject"]);
|
return $this->dbObject->delete ($idobjects[0]["idobject"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -372,6 +374,7 @@ class authzgroups
|
|||||||
if (! isset ($idobjects[0]["idobject"]))
|
if (! isset ($idobjects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbObject->delete ($idobjects[0]["idobject"]);
|
return $this->dbObject->delete ($idobjects[0]["idobject"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -385,6 +388,7 @@ class authzgroups
|
|||||||
if (! isset ($idobjects[0]["idobject"]))
|
if (! isset ($idobjects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbObject->update ($idobjects[0]["idobject"],
|
return $this->dbObject->update ($idobjects[0]["idobject"],
|
||||||
array ("object"=>$newobject,
|
array ("object"=>$newobject,
|
||||||
"comment"=>$newcomment));
|
"comment"=>$newcomment));
|
||||||
@@ -401,6 +405,7 @@ class authzgroups
|
|||||||
if (! isset ($idobjects[0]["idobject"]))
|
if (! isset ($idobjects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbObject->update ($idobjects[0]["idobject"],
|
return $this->dbObject->update ($idobjects[0]["idobject"],
|
||||||
array ("object"=>$newobject,
|
array ("object"=>$newobject,
|
||||||
"comment"=>$newcomment));
|
"comment"=>$newcomment));
|
||||||
@@ -568,6 +573,7 @@ class authzgroups
|
|||||||
if (! isset ($groups[0]["idgroup"]))
|
if (! isset ($groups[0]["idgroup"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted group not found"), 404);
|
"Wanted group not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbGroupMember->insert (array (
|
return $this->dbGroupMember->insert (array (
|
||||||
"user"=>$user,
|
"user"=>$user,
|
||||||
"idgroup"=>$groups[0]["idgroup"],
|
"idgroup"=>$groups[0]["idgroup"],
|
||||||
@@ -591,6 +597,7 @@ class authzgroups
|
|||||||
if (! isset ($groupsMembers[0]["idgroupmember"]))
|
if (! isset ($groupsMembers[0]["idgroupmember"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted GroupMember not found"), 404);
|
"Wanted GroupMember not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]);
|
return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -611,12 +618,14 @@ class authzgroups
|
|||||||
if (! isset ($groupsMembers[0]["idgroupmember"]))
|
if (! isset ($groupsMembers[0]["idgroupmember"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted GroupMember not found"), 404);
|
"Wanted GroupMember not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]);
|
return $this->dbGroupMember->delete ($groupsMembers[0]["idgroupmember"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Update an groupmember in the database */
|
/** Update an groupmember in the database */
|
||||||
public function groupmemberUpdate ($module, $group, $user, $comment="")
|
public function groupmemberUpdate ($module, $group, $user, $comment="")
|
||||||
{
|
{
|
||||||
|
$this->rightCache = null;
|
||||||
die ("This function is not available : contact us if you need it\n");
|
die ("This function is not available : contact us if you need it\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -628,6 +637,7 @@ class authzgroups
|
|||||||
if (count ($datas) === 0)
|
if (count ($datas) === 0)
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"IDUser in IDGroup not found"), 404);
|
"IDUser in IDGroup not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbGroupMember->update ($iduser,
|
return $this->dbGroupMember->update ($iduser,
|
||||||
array ("user"=>$user,
|
array ("user"=>$user,
|
||||||
"comment"=>$comment));
|
"comment"=>$comment));
|
||||||
@@ -748,6 +758,7 @@ class authzgroups
|
|||||||
if (! isset ($objects[0]["idobject"]))
|
if (! isset ($objects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"],
|
return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"],
|
||||||
"idobject"=>$objects[0]["idobject"],
|
"idobject"=>$objects[0]["idobject"],
|
||||||
"right"=>$right,
|
"right"=>$right,
|
||||||
@@ -778,6 +789,7 @@ class authzgroups
|
|||||||
if (! isset ($objects[0]["idobject"]))
|
if (! isset ($objects[0]["idobject"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted object not found"), 404);
|
"Wanted object not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"],
|
return $this->dbRight->insert (array ("idgroup"=>$groups[0]["idgroup"],
|
||||||
"idobject"=>$objects[0]["idobject"],
|
"idobject"=>$objects[0]["idobject"],
|
||||||
"right"=>$right,
|
"right"=>$right,
|
||||||
@@ -795,6 +807,7 @@ class authzgroups
|
|||||||
if (!isset ($idrights[0]["idright"]))
|
if (!isset ($idrights[0]["idright"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted right not found"), 404);
|
"Wanted right not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->delete ($idrights[0]["idright"]);
|
return $this->dbRight->delete ($idrights[0]["idright"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -808,6 +821,7 @@ class authzgroups
|
|||||||
if (!isset ($idrights[0]["idright"]))
|
if (!isset ($idrights[0]["idright"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted right not found"), 404);
|
"Wanted right not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->delete ($idrights[0]["idright"]);
|
return $this->dbRight->delete ($idrights[0]["idright"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -831,6 +845,7 @@ class authzgroups
|
|||||||
if (!isset ($idrights[0]["idright"]))
|
if (!isset ($idrights[0]["idright"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted right not found"), 404);
|
"Wanted right not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->update ($idrights[0]["idright"],
|
return $this->dbRight->update ($idrights[0]["idright"],
|
||||||
array ("right"=>$newright,
|
array ("right"=>$newright,
|
||||||
"comment"=>$newcomment));
|
"comment"=>$newcomment));
|
||||||
@@ -856,6 +871,7 @@ class authzgroups
|
|||||||
if (!isset ($idrights[0]["idright"]))
|
if (!isset ($idrights[0]["idright"]))
|
||||||
throw new Exception (dgettext ("domframework",
|
throw new Exception (dgettext ("domframework",
|
||||||
"Wanted right not found"), 404);
|
"Wanted right not found"), 404);
|
||||||
|
$this->rightCache = null;
|
||||||
return $this->dbRight->update ($idrights[0]["idright"],
|
return $this->dbRight->update ($idrights[0]["idright"],
|
||||||
array ("idobject"=>$newidobject,
|
array ("idobject"=>$newidobject,
|
||||||
"right"=>$newright,
|
"right"=>$newright,
|
||||||
|
|||||||
Reference in New Issue
Block a user