From f117bf310d4889125e62e39fd8afbfc6acbddc4a Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 22 Mar 2006 08:49:56 +0000 Subject: [PATCH] Fixed application freezing git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2887 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_ldap.inc | 9 ++++----- plugins/admin/fai/class_faiManagement.inc | 9 +++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 70b1a09f5..07797798f 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -400,15 +400,16 @@ class LDAP{ function copy_FAI_resource_recursive($sourcedn,$destinationdn,$type="branch",$is_first = true,$depth=0) { error_reporting(E_ALL); - + if($is_first){ echo "

". sprintf(_("Creating duplicate of %s in %s"),"
".$sourcedn."
","
".$destinationdn."
")."

"; }else{ - if($depth == 1 ){ + if(preg_match("/^ou=/",$sourcedn)){ echo "

"._("Processing")." : ".preg_replace("/,.*$/","",$destinationdn)."

"; }else{ $tmp = split(",",$sourcedn); + echo "Current object : "; for($i = 0; $i < ($depth -1 ) ; $i ++) { echo preg_replace("/^.*=/","",$tmp[$i])." "; @@ -482,9 +483,7 @@ class LDAP{ /* Add this entry */ $this->modify($attr); } - echo "Department"; }else{ - echo "Object"; /* If this is no department */ foreach($attr as $key => $value){ @@ -556,7 +555,7 @@ class LDAP{ } } if($is_first){ - echo "

"._("Successfully finished")."
"; + echo "
"._("Successfully finished")."


"; } } diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 43921fa78..730501ea5 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -423,12 +423,17 @@ class faiManagement extends plugin $appsrc = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=apps,",$baseToUse); $appdst = preg_replace("/ou=fai,ou=configs,ou=systems,/","ou=apps,","ou=".$name.",".$baseToUse) ; - $ldap->cd ("ou=".$name.",".$baseToUse); + /* Duplicate applications + */ + $ldap->cd ($appdst); $ldap->recursive_remove(); - $ldap->cd ($this->config->current['BASE']); $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$type,true); + /* Duplicate fai objects + */ + $ldap->cd ("ou=".$name.",".$baseToUse); + $ldap->recursive_remove(); $ldap->cd ($this->config->current['BASE']); $ldap->copy_FAI_resource_recursive($baseToUse,"ou=".$name.",".$baseToUse,$type,true); -- 2.30.2