X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_userinfo.inc;h=e550a47d83aa1d08a2be8a835eae9ca96b51c398;hb=9566dc068208034acf0da2630a7efbb5a370f191;hp=80c0440f1f5e31264db102d2dbae97d3c72c9193;hpb=25189ac46b2f1c8c4955f33a526ea5cff7b926fe;p=gosa.git diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 80c0440f1..e550a47d8 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -37,7 +37,7 @@ class userinfo var $ocMapping= array(); var $groups= array(); var $result_cache =array(); - var $ignoreACL = FALSE; + var $ignoreACL = NULL; var $ACLperPath = array(); var $ACLperPath_usesFilter = array(); @@ -77,8 +77,6 @@ class userinfo $this->uid= $attrs['uid'][0]; $this->ip= $_SERVER['REMOTE_ADDR']; - $this->ignoreACL = ($this->config->get_cfg_value("ignoreAcl") == $this->dn); - /* Initialize ACL_CACHE */ $this->reset_acl_cache(); } @@ -365,12 +363,13 @@ class userinfo /* Check for correct category and class values... */ if(strpos($object,'/') !== FALSE){ - list($aclCategory, $aclClass) = split("/", $object); + list($aclCategory, $aclClass) = preg_split("!/!", $object); }else{ $aclCategory = $object; } - if($this->config->get_cfg_value("displayerrors") == "true"){ + if($this->config->boolValueIsTrue("core","developmentMode")){ + if(!isset($this->ocMapping[$aclCategory])){ trigger_error("Invalid ACL category '".$aclCategory."'! ({$object})"); return(""); @@ -378,7 +377,7 @@ class userinfo trigger_error("Invalid ACL class '".$aclClass."'! ({$object})"); return(""); } - if(isset($aclClass) &&class_available($aclClass)){ + if(isset($aclClass) && $aclClass != '0' && class_available($aclClass)){ $plInfo = call_user_func(array($aclClass, 'plInfo')); if(!empty($attribute) && !isset($plInfo['plProvidedAcls'][$attribute])){ trigger_error("Invalid ACL attribute '".$attribute."'! ({$object})"); @@ -448,12 +447,6 @@ class userinfo /* Inspect this ACL, place the result into ACL */ foreach ($ACL[$cpath] as $subacl){ - /* Reset? Just clean the ACL and turn over to the next one... */ - if ($subacl['type'] == 'reset'){ - $acl= $this->cleanACL($acl, TRUE); - continue; - } - if($subacl['type'] == "role") { echo "role skipped"; continue; @@ -470,6 +463,12 @@ class userinfo } } + /* Reset? Just clean the ACL and turn over to the next one... */ + if ($subacl['type'] == 'reset'){ + $acl= $this->cleanACL($acl, TRUE); + continue; + } + /* Self ACLs? */ if($dn != $this->dn && isset($subacl['acl'][$object][0]) && (strpos($subacl['acl'][$object][0],"s") !== FALSE)){ @@ -499,6 +498,12 @@ class userinfo } /* Global ACL? */ + if (isset($subacl['acl']['all/all'][0])){ + $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl']['all/all'][0]); + continue; + } + + /* Global ACL? - Old style global ACL - Was removed since class_core.inc was created */ if (isset($subacl['acl']['all'][0])){ $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl']['all'][0]); continue; @@ -517,7 +522,10 @@ class userinfo foreach($this->ocMapping[$ocs] as $oc){ if (isset($subacl['acl'][$ocs.'/'.$oc])){ - if($dn != $this->dn && strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue; + // Skip ACLs wich are defined for ourselfs only - if not checking against ($ui->dn) + if(isset($subacl['acl'][$ocs.'/'.$oc][0]) && + $dn != $this->dn && + strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue; foreach($subacl['acl'][$ocs.'/'.$oc] as $attr => $dummy){ $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][$attr]); @@ -735,7 +743,7 @@ class userinfo } } }else{ - if($this->config->get_cfg_value("displayerrors") == "true"){ + if($this->config->boolValueIsTrue("core","developmentMode")){ trigger_error("Invalid type of category ".$category); } $acl = ""; @@ -754,6 +762,9 @@ class userinfo */ function ignore_acl_for_current_user() { + if($this->ignoreACL === NULL){ + $this->ignoreACL = ($this->config->get_cfg_value("core","ignoreAcl") == $this->dn); + } return($this->ignoreACL); }