From: hickert Date: Mon, 10 Jul 2006 04:02:19 +0000 (+0000) Subject: updated functions_FAI to reset the FAIstate attribute when storing new objects X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=290958fa927751fcd0b921ec6feb0dc443fb8c14;p=gosa.git updated functions_FAI to reset the FAIstate attribute when storing new objects git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4053 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions_FAI.inc b/include/functions_FAI.inc index 69fb31464..5bb4da912 100644 --- a/include/functions_FAI.inc +++ b/include/functions_FAI.inc @@ -171,6 +171,10 @@ function array_diff_FAI($ar1,$ar2) $ar1[$key1] = $val1[0]; } + if(!isset($ar2[$key1])){ + return(true); + } + if((is_array($ar2[$key1])) && (count($ar2[$key1])==1)){ $val1 = $val1[0]; $ar2[$key1] = $ar2[$key1][0]; @@ -238,7 +242,7 @@ function save_release_changes_now() }else{ $is_new = false; } - + /* if parameter removed is true, we have to add FAIstate to the current attrs FAIstate should end with ...|removed after this operation */ if($removed ){ @@ -435,9 +439,14 @@ function save_FAI_object($dn,$attrs) $ldap->cd($config->current['BASE']); $ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $dn)); $ldap->cd($dn); - + $ldap->cat($dn,array("dn")); if($ldap->count()){ + + if(!isset($attrs['FAIstate'])){ + $attrs['FAIstate'] = array(); + } + $ldap->modify($attrs); }else{ $ldap->add($attrs);