Code

Fixed application freezing
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Mar 2006 08:49:56 +0000 (08:49 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Mar 2006 08:49:56 +0000 (08:49 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2887 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_ldap.inc
plugins/admin/fai/class_faiManagement.inc

index 70b1a09f50a276db0fa90966a87b51698bdc8e2a..07797798f588a0cffa6a2b512dab071e65a34686 100644 (file)
@@ -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 "<font style='font-size:11px;'><h4>".
               sprintf(_("Creating duplicate of %s in %s"),"<br><i>".$sourcedn."</i><br>","<br><i>".$destinationdn."</i><br>")."</h4>";
     }else{
-      if($depth == 1 ){
+      if(preg_match("/^ou=/",$sourcedn)){
         echo "<br><h3>"._("Processing")." : ".preg_replace("/,.*$/","",$destinationdn)."</h3>";
       }else{
         $tmp = split(",",$sourcedn);
+        
         echo "<b>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 "<br><br><b>"._("Successfully finished")."</b></font>";
+      echo "<br><b>"._("Successfully finished")."</b></font><br><br><br>";
     }
 
   }
index 43921fa7832b622497b9dfcc0da82f170d28cafe..730501ea5cd23885a451ba7a983c83f52b78c9ee 100644 (file)
@@ -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);