From: hickert Date: Tue, 20 Apr 2010 08:34:15 +0000 (+0000) Subject: Updated ACL stuff X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=614ba4f14fd15cdaf18d6c5dd37e809c8d5dddcb;p=gosa.git Updated ACL stuff -Only display errors when activated git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17730 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index bcff8c836..1eb5690b4 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -365,19 +365,22 @@ class userinfo }else{ $aclCategory = $object; } - if(!isset($this->ocMapping[$aclCategory])){ - trigger_error("Invalid ACL category '".$aclCategory."'! ({$object})"); - return(""); - }elseif(isset($aclClass) && !in_array($aclClass, $this->ocMapping[$aclCategory])){ - trigger_error("Invalid ACL class '".$aclClass."'! ({$object})"); - return(""); - } - if(isset($aclClass) &&class_available($aclClass)){ - $plInfo = call_user_func(array($aclClass, 'plInfo')); - if(!empty($attribute) && !isset($plInfo['plProvidedAcls'][$attribute])){ - trigger_error("Invalid ACL attribute '".$attribute."'! ({$object})"); - return(""); - } + + if($this->config->get_cfg_value("displayerrors") == "true"){ + if(!isset($this->ocMapping[$aclCategory])){ + trigger_error("Invalid ACL category '".$aclCategory."'! ({$object})"); + return(""); + }elseif(isset($aclClass) && !in_array($aclClass, $this->ocMapping[$aclCategory])){ + trigger_error("Invalid ACL class '".$aclClass."'! ({$object})"); + return(""); + } + if(isset($aclClass) &&class_available($aclClass)){ + $plInfo = call_user_func(array($aclClass, 'plInfo')); + if(!empty($attribute) && !isset($plInfo['plProvidedAcls'][$attribute])){ + trigger_error("Invalid ACL attribute '".$attribute."'! ({$object})"); + return(""); + } + } } /* Detect the set of ACLs we have to check for this object @@ -726,7 +729,9 @@ class userinfo } } }else{ - trigger_error("Invalid type of category ".$category); + if($this->config->get_cfg_value("displayerrors") == "true"){ + trigger_error("Invalid type of category ".$category); + } $acl = ""; } $this->result_cache['has_complete_category_acls'][$dn][$category] = $acl;