summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8833b76)
raw | patch | inline | side by side (parent: 8833b76)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 30 Oct 2008 09:41:23 +0000 (09:41 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 30 Oct 2008 09:41:23 +0000 (09:41 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12823 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_userinfo.inc | patch | blob | history |
index a54892f507c0184afd735ecb19b37a0508598e82..8645b5aedd0f41706867708a54d981160e11ec94 100644 (file)
$this->ignoreACL = ($this->config->get_cfg_value("ignoreAcl") == $this->dn);
/* Initialize ACL_CACHE */
- session::set('ACL_CACHE',array());
$this->reset_acl_cache();
}
function get_category_permissions($dn, $category, $any_acl = FALSE)
{
+
+ $ACL_CACHE = &session::get("ACL_CACHE");
+ $id = $dn."+".$category."+".$any_acl;
+ if(isset($ACL_CACHE['CATEGORY_ACL'][$id])){
+ return($ACL_CACHE['CATEGORY_ACL'][$id]);
+ }
+
/* If we are forced to skip ACLs checks for the current user
then return all permissions.
*/
if (isset($this->ocMapping[$category])){
foreach($this->ocMapping[$category] as $oc){
$acl.= $this->get_permissions($dn, $category."/".$oc);
- if($any_acl && !empty($acl)) return($acl);
+ if($any_acl && !empty($acl)){
+ break;
+ }
}
}else{
trigger_error("ACL request for an invalid category (".$category.").");
}
-
+ $ACL_CACHE = &session::get("ACL_CACHE");
+ $ACL_CACHE['CATEGORY_ACL'][$id] = $acl;
return ($acl);
}
/* With user filter */
if (isset($subacl['filter']) && !empty($subacl['filter'])){
$id = $dn."-".$subacl['filter'];
- if(!isset($ACL_CACHE[$id])){
- $ACL_CACHE[$id] = $ldap->object_match_filter($dn,$subacl['filter']);
- }elseif(!$ACL_CACHE[$id]){
+ if(!isset($ACL_CACHE['FILTER'][$id])){
+ $ACL_CACHE['FILTER'][$id] = $ldap->object_match_filter($dn,$subacl['filter']);
+ }
+ if(!$ACL_CACHE['FILTER'][$id]){
continue;
}
}
/* Self ACLs?
*/
- if(isset($subacl['acl'][$object][0]) && preg_match("/s/",$subacl['acl'][$object][0]) && $dn != $this->dn){
+ if($dn != $this->dn && isset($subacl['acl'][$object][0]) && strpos($subacl['acl'][$object][0],"s")){
continue;
}
}
/* Use cached results if possilbe */
- $ACL_CACHE = session::get('ACL_CACHE');
+ $ACL_CACHE = &session::get('ACL_CACHE');
if(!is_array($module)){
$module = array($module);
}
$ACL_CACHE['MODULE_DEPARTMENTS'][$mod] = $deps;
- session::set('ACL_CACHE',$ACL_CACHE);
-
$res = array_merge($res,$deps);
}
return ($res);