Code

Added FAIdebianRelease rewriting to branch / freeze function.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 04:38:04 +0000 (04:38 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 1 Jun 2006 04:38:04 +0000 (04:38 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3591 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index 2ed4ceea0fb67439592bbb13dc17437d39aae4a1..b6a11be99f2d8a1dbe8a99607abd0a983040e94e 100644 (file)
@@ -439,7 +439,7 @@ class LDAP{
 
   /* Copy given attributes and sub-dns with attributes to destination dn 
   */
-  function copy_FAI_resource_recursive($sourcedn,$destinationdn,$type="branch",$is_first = true,$depth=0)
+  function copy_FAI_resource_recursive($sourcedn,$destinationdn,$destinationName,$type="branch",$is_first = true,$depth=0)
   {
     error_reporting(E_ALL);
     
@@ -554,6 +554,11 @@ class LDAP{
             }
           }
 
+          /* Replace FAIdebianRelease with new release name */
+          if(in_array("FAIpackageList" , $attr['objectClass'])){
+            $attr['FAIdebianRelease'] = $destinationName; 
+          }
+
           /* Add entry */
           $this->cd($destinationdn);
           $this->cat($destinationdn);
@@ -588,7 +593,7 @@ class LDAP{
           $this->cd($basedn);
           $item = $this->fetch($this->cat($dn));
           if(!in_array("FAIbranch",$item['objectClass'])){
-            $this->copy_FAI_resource_recursive($dn,str_replace($sourcedn,$destinationdn,$dn),$type,false,$depth);
+            $this->copy_FAI_resource_recursive($dn,str_replace($sourcedn,$destinationdn,$dn),$destinationName,$type,false,$depth);
           } 
         }
       }
index b134623f088450d70d8a42dc6fe6c2309c3ba2c4..0fac333facd739f0c5c01e62f83e8c5a7523ec48 100644 (file)
@@ -353,6 +353,19 @@ class faiManagement extends plugin
       if($this->DivListFai->selectedBranch != "main" ){
         $baseToUse = $this->DivListFai->selectedBranch;
       }
+  
+      /* Create new Release name to be able to set faidebianRelease for FAIpackageList */
+      
+      $CurrentReleases  = $this->getBranches();
+      $NewReleaseName   = $name;
+      if(isset($CurrentReleases[$this->DivListFai->selectedBranch])) {
+        if($this->DivListFai->selectedBranch != "main"){
+          $NewReleaseName = $CurrentReleases[$this->DivListFai->selectedBranch]."/".$name;
+          $NewReleaseName = preg_replace("#\/#","/",$NewReleaseName); 
+        }else{
+          $NewReleaseName   = $name;
+        }
+      }
 
       $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) ; 
@@ -366,14 +379,14 @@ class faiManagement extends plugin
       $ldap->cd ($appdst);
       $ldap->recursive_remove();
       $ldap->cd ($this->config->current['BASE']);
-      $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$type,true);
+      $ldap->copy_FAI_resource_recursive($appsrc,$appdst,$NewReleaseName,$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);
+      $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")."'>