Code

Updated ACL stuff
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Apr 2010 08:34:15 +0000 (08:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 20 Apr 2010 08:34:15 +0000 (08:34 +0000)
-Only display errors when activated

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17730 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_userinfo.inc

index bcff8c8360da076be418a7c04a057d5195278b50..1eb5690b48278ad10261ed41bbc7d8d7f8ce6c09 100644 (file)
@@ -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;