Code

Updated faiManagement release creation
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Jul 2006 04:57:51 +0000 (04:57 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 7 Jul 2006 04:57:51 +0000 (04:57 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4037 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_faiManagement.inc

index c64e6285db83b0344b4c424931a6d406dc084939..f0bf4d00abc53cd2ed5bb6368fb1d920af21ed9d 100644 (file)
@@ -196,6 +196,13 @@ class faiManagement extends plugin
                                unset ($this->dialog);
                                gosa_log ("FAI class '".$this->dn."' has been removed");
                                $this->dialog= NULL;
+        $to_del = clean_up_releases($this->dn);
+
+        foreach($to_del as $dn){
+          $ldap->rmdir_recursive($dn);
+          gosa_log(sprintf(_("Release cleanup : Removing object (tagged as remvoed) that is no longer in use '%s'."),$dn));
+        }
+
                        } else {
 
                                /* Normally this shouldn't be reached, send some extra
@@ -392,12 +399,25 @@ class faiManagement extends plugin
       $ldap->cd ($this->config->current['BASE']);
       $ldap->copy_FAI_resource_recursive($mimesrc,$mimedst,$NewReleaseName,$type,true);
 
+
+      $attr = array();
+      $attr['objectClass'] = array("organizationalUnit","FAIbranch");
+      $attr['ou'] = $name;
+      $ldap->cd($this->config->current['BASE']);
+      $ldap->cd("ou=".$name.",".$baseToUse);
+      $ldap->cat("ou=".$name.",".$baseToUse);
+      if($ldap->count()){
+        $ldap->modify($attr);
+      }else{
+        $ldap->add($attr);
+      }
+
       /* 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,$NewReleaseName,$type,true);
+//      $ldap->cd ("ou=".$name.",".$baseToUse);
+//      $ldap->recursive_remove();
+//      $ldap->cd ($this->config->current['BASE']);
+//      $ldap->copy_FAI_resource_recursive($baseToUse,"ou=".$name.",".$baseToUse,$NewReleaseName,$type,true);
 
       echo "<div style='width:100%;text-align:right;'><form name='form' method='post' action='?plug=".$_GET['plug']."' target='_parent'>
               <br><input type='submit' name='CloseIFrame' value='"._("Continue")."'>