Code

I really start hating those @ in front of function calls... makes debugging very...
[gosa.git] / gosa-core / include / class_userinfo.inc
index 1b5fac84eb57e51b426f94f8f004acc4d57790e1..57d1fc3036033e49498fc9f418e9594d569ccc0f 100644 (file)
@@ -258,7 +258,7 @@ class userinfo
 
   function get_category_permissions($dn, $category, $any_acl = FALSE)
   {
-    return(@$this->get_permissions($dn,$category.'/0',""));
+    return($this->get_permissions($dn,$category.'/0',""));
   }
 
   
@@ -359,6 +359,22 @@ class userinfo
       return($ret);
     }
 
+    /* Check for correct category and class values... */
+    if(strpos($object,'/') !== FALSE){
+      list($aclCategory, $aclClass) = split("/", $object);
+    }else{
+      $aclCategory = $object;
+    }
+    if(!isset($this->ocMapping[$aclCategory])){
+      trigger_error("Invalid ACL category '".$aclCategory."'! ({$object})");
+      msg_dialog::display(_("Error"), "Invalid ACL category '".$aclCategory."'! ({$object})", ERROR_DIALOG);
+      return("");
+    }elseif(isset($aclClass) && !in_array($aclClass, $this->ocMapping[$aclCategory])){
+      trigger_error("Invalid ACL class '".$aclClass."'! ({$object})");
+      msg_dialog::display(_("Error"), "Invalid ACL class '".$aclClass."'! ({$object})", ERROR_DIALOG);
+      return("");
+    }
+
     /* Detect the set of ACLs we have to check for this object 
      */
     $adn = $dn;