From: hickert Date: Mon, 4 Jun 2007 09:18:42 +0000 (+0000) Subject: Updated fai functions used for saving. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=44d2c1d199e0b429b0bf87ae1d4d90cae154a67e;p=gosa.git Updated fai functions used for saving. Changes wasn't saved sometimes. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6528 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions_FAI.inc b/include/functions_FAI.inc index acbf11741..26c0a5726 100644 --- a/include/functions_FAI.inc +++ b/include/functions_FAI.inc @@ -184,7 +184,7 @@ function array_diff_FAI($ar1,$ar2) } ksort($ar1); ksort($ar2); - if(count( array_diff($ar1,$ar2))){ + if(count( array_diff($ar1,$ar2)) || arr_diff($ar1,$ar2)){ return(true); }else{ return(false); @@ -192,6 +192,21 @@ function array_diff_FAI($ar1,$ar2) } +function arr_diff($ar1,$ar2) +{ + foreach($ar1 as $ak1 => $av1){ + if(!isset($ar2[$ak1]) || (!($av1 === $ar2[$ak1]))){ + return(true); + }elseif(is_array($av1)){ + return(arr_diff($av1,$ar2[$ak1])); + } + } + return(FALSE); +} + + + + /* check which objects must be saved, and save them */ function save_release_changes_now() {