Code

Updated FAI class
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Aug 2008 08:47:10 +0000 (08:47 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 11 Aug 2008 08:47:10 +0000 (08:47 +0000)
-Fixed error with duplicated objectClass in release creation.

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

gosa-plugins/fai/admin/fai/class_FAI.inc

index ffa7427dcd9b050b32b3a566da082e64a5661b7d..ec75c333ef381f33ecad3e02390b42bc4688f0f2 100644 (file)
@@ -8,6 +8,21 @@ class FAI
 
   /* TEST PHASE .... */
 
+  static function get_all_objects_for_given_object($dn,$filter,$detailed = false)
+  {
+    $res  = FAI::get_all_objects_for_given_base($dn,$filter,$detailed);
+    $name = preg_replace("/,ou=.*$/","",$dn);
+    $entries = array();
+    foreach($res as $entry_dn => $data){
+      if(!preg_match("/,".$name.",/",$entry_dn)) continue;
+      $entries[$entry_dn] = $data; 
+    }
+    return($entries);
+  }
+
+
+
+
   /* Returns all object for the given release.
      This function resolves the releases  
      from base up to the given dn.
@@ -1121,7 +1136,7 @@ class FAI
         }
         unset($attr['count']);
         unset($attr['dn']);
-        if(!in_array("FAIclass",$attr['objectClass'])){
+        if(!in_array("FAIobject",$attr['objectClass'])){
           $attr['objectClass'][] = "FAIobject";
         }
         $attr['FAIstate'] = $type;