X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Ffunctions_FAI.inc;h=acbf117411d703c43c4ed1880a5222dd550d1148;hb=5fb44ad64771094c678181a7e1a4ed0f159b0d5a;hp=6843c0d48610a32c24fdfcf0b5dbf5515a6f75c5;hpb=84a1a15abf03721b28b479827cab41aa035cb6b9;p=gosa.git diff --git a/include/functions_FAI.inc b/include/functions_FAI.inc index 6843c0d48..acbf11741 100644 --- a/include/functions_FAI.inc +++ b/include/functions_FAI.inc @@ -37,14 +37,13 @@ function get_all_objects_for_given_base($Current_DN,$filter,$detailed = false) foreach($deps_to_search as $fai_base){ /* Ldap search for fai classes specified in this release */ - $ldap->cd($fai_base); - $ldap->search($filter,array("dn","objectClass","FAIstate")); - + $res_tmp = get_list($filter,"fai",$fai_base,array("dn","objectClass","FAIstate"),GL_SUBSEARCH | GL_SIZELIMIT); + /* check the returned objects, and add/replace them in our return variable */ - while($attr = $ldap->fetch()){ + foreach($res_tmp as $attr){ $buffer = array(); - $name = str_ireplace($release,"",$attr['dn']); + $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']); if(isset($attr['FAIstate'][0])){ if(preg_match("/removed$/",$attr['FAIstate'][0])){ @@ -279,7 +278,7 @@ function save_release_changes_now() /* Check if this a leaf release or not */ if(count($following_releases) == 0 ){ - /* This is a leaf object. It isn't unherited by any other object */ + /* This is a leaf object. It isn't inherited by any other object */ if(DEBUG_FAI_FUNC) { echo "Saving directly, is a leaf object
".$Current_DN; print_a($objectAttrs); @@ -402,7 +401,8 @@ function clean_up_releases($Current_DN) while($attr = $ldap->fetch()){ $buffer = array(); - $name = str_ireplace($release,"",$attr['dn']); +# $name = str_ireplace($release,"",$attr['dn']); + $name = preg_replace("/".normalizePreg($release)."/i","",$attr['dn']); if(isset($attr['FAIstate'][0])&&(preg_match("/removed$/",$attr['FAIstate'][0]))){ @@ -507,7 +507,8 @@ function get_following_releases_that_inherit_this_object($dn) $sub_releases = get_sub_releases_of_this_release($base_release); /* Get dn suffix. Example "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */ - $dn_suffix = str_ireplace($base_release,"",$dn); +# $dn_suffix = str_ireplace($base_release,"",$dn); + $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn); /* Check if given object also exists whitin one of these releases */ foreach($sub_releases as $p_release => $name){ @@ -547,7 +548,8 @@ function get_parent_release_object($dn,$include_myself=true) } /* Get dn suffix. Example "FAIvairableEntry=keksdose,FAIvariable=Keksregal," */ - $dn_suffix = str_ireplace($base_release,"",$dn); +# $dn_suffix = str_ireplace($base_release,"",$dn); + $dn_suffix = preg_replace("/".normalizePreg($base_release)."/i","",$dn); /* Check if given object also exists whitin one of these releases */ foreach($previous_releases as $p_release){ @@ -571,7 +573,8 @@ function get_previous_releases_of_this_release($dn,$flat) $ret = array(); /* Explode dns into pieces, to be able to build parent dns */ - $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$dn),0); + $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$dn)); + if(!is_array($dns_to_check)){ return; } @@ -675,7 +678,8 @@ function get_release_dn($Current_DN) $ldap->cd($config->current['BASE']); /* Split dn into pices */ - $dns_to_check = ldap_explode_dn(str_ireplace(",".$config->current['BASE'],"",$Current_DN),0); + $dns_to_check = gosa_ldap_explode_dn(preg_replace("/".normalizePreg(",".$config->current['BASE'])."/i","",$Current_DN)); + if(!is_array($dns_to_check)){ return; }