From bc9e713279078ffcc0849aa00fe0f4fe26d16fe9 Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 14 Apr 2008 07:04:06 +0000 Subject: [PATCH] Fixed saving of FAI classes -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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_FAI.inc b/gosa-plugins/fai/admin/fai/class_FAI.inc index fc4f5c185..eb01e71de 100644 --- a/gosa-plugins/fai/admin/fai/class_FAI.inc +++ b/gosa-plugins/fai/admin/fai/class_FAI.inc @@ -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){ -- 2.30.2