Code

Fixed saving of FAI classes
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 07:04:06 +0000 (07:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 14 Apr 2008 07:04:06 +0000 (07:04 +0000)
-Object modifications weren't detected corrently.

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

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

index fc4f5c1856782abe00568e3f643b0306b0e3a8f2..eb01e71de430a2b9738e9d3581bd3b560013e782 100644 (file)
@@ -179,7 +179,7 @@ class FAI
          */
         $ldap->cat($obj_dn);
         $attrs = $ldap->fetch();
-        $classes = array("FAIprofile","FAIscript","FAIpackage","FAIpartitionTable","FAIHook","FAIvariable","FAItemplate");
+        $classes = array("FAIprofile","FAIscript","FAIpackageList","FAIpartitionTable","FAIHook","FAIvariable","FAItemplate");
         if(count(array_intersect($classes,$attrs['objectClass']))){
           $cn    = $attrs['cn'][0];
 
@@ -275,9 +275,12 @@ class FAI
   {
     foreach($ar1 as $ak1 => $av1){
       if(!isset($ar2[$ak1]) || (!($av1 === $ar2[$ak1]))){
-        return(true);
+        return(TRUE);    
       }elseif(is_array($av1)){
-        return(FAI::arr_diff($av1,$ar2[$ak1]));
+        $ret = (FAI::arr_diff($av1,$ar2[$ak1]));
+        if($ret) {
+          return(TRUE);
+        }
       }
     }
     return(FALSE);
@@ -295,9 +298,11 @@ class FAI
     /* check which objects must be saved */
     $FAI_objects_to_save = session::get('FAI_objects_to_save');
     if(!is_array($FAI_objects_to_save)) {
+      print_a(array(session::get('FAI_objects_to_save')));
       trigger_error("Can't save FAI objects, no array given.");
       return;
     }
+  
     foreach($FAI_objects_to_save as $Current_DN => $object){
       if($object['diff']){
         $sub_name = $Current_DN;
@@ -321,6 +326,7 @@ class FAI
     }
     $to_save = $tmp;
 
+
     /* Save objects and manage the correct release behavior*/
     foreach($to_save as $save){