index 9b68abc5421fd6b61015946b61cf904162f6cd18..097c7ccdc90f2030cdd4cbc0d35b5e28ba0ff126 100644 (file)
/* Initialize ACL_CACHE */
$_SESSION['ACL_CACHE']= array();
+ $this->reset_acl_cache();
}
+ public function reset_acl_cache()
+ {
+ /* Initialize ACL_CACHE */
+ $_SESSION['ACL_CACHE']= array();
+ }
+
function loadACL()
{
$this->ACL= array();
$this->groups= array();
$this->result_cache =array();
+ $this->reset_acl_cache();
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->config->current['BASE']);
{
/* Push cache answer? */
if (isset($_SESSION['ACL_CACHE']["$dn+$object+$attribute"])){
- return ($_SESSION['ACL_CACHE']["$dn+$object+$attribute"]);
+
+ /* Remove write if needed */
+ if ($skip_write){
+ $ret = preg_replace('/w/', '', $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]);
+ }else{
+ $ret = $_SESSION['ACL_CACHE']["$dn+$object+$attribute"];
+ }
+ return($ret);
}
$acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
}
}
+ $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]= $ret;
+
/* Remove write if needed */
if ($skip_write){
$ret= preg_replace('/w/', '', $ret);
}
-
- $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]= $ret;
return ($ret);
}
accessible department) */
function get_module_departments($module)
{
+ /* Use cached results if possilbe */
+ if(isset($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)])){
+ return($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)]);
+ }
+
global $plist;
$objects= array();
}
}
+ $_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)] = $deps;
return ($deps);
}