Code

Some updates for branch
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Jan 2006 16:31:11 +0000 (16:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 10 Jan 2006 16:31:11 +0000 (16:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2438 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/fai/class_askClassName.inc
plugins/admin/fai/class_faiManagement.inc

index a5bddcd7f4b0987a597b0e1195cdedf62fe3add4..13b923a8b0cbd45c1014b117e408b4058d9de4a3 100644 (file)
@@ -42,11 +42,10 @@ class askClassName extends plugin
      * With a second search detect all object that belong to the different ous. 
      */
 
-    $bb ="";
+    $base = "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
     if($faifilter['branch'] != "main"){
-      $bb = "ou=".$faifilter['branch'].",";
+      $base = $faifilter['branch'];
     }
-    $base = $bb."ou=fai,ou=configs,ou=systems,".$faifilter['base'];
     $ldap = $this->config->get_ldap_link();
     $res  = get_list($this->ui->subtreeACL, "(objectClass=organizationalUnit)",FALSE, $base, array("cn","description","objectClass"),TRUE);
     $used = array();
index 42438f6dddf83dc383e8f7e19528ba1fb652ced4..17971a305dda1423d352b9bca4d7944e0c133f18 100644 (file)
@@ -320,11 +320,16 @@ class faiManagement extends plugin
         /* Create it know */
         $ldap = $this->config->get_ldap_link();
 
-        $ldap->cd ("ou=".$name.",".$base);
+        $baseToUse = $base;
+        if($_SESSION['faifilter']['branch']!="main"){
+          $baseToUse = $_SESSION['faifilter']['branch'];
+        }
+
+        $ldap->cd ("ou=".$name.",".$baseToUse);
         $ldap->recursive_remove();
         
         $ldap->cd ($this->config->current['BASE']);
-        $ldap->copy_FAI_resource_recursive($base,"ou=".$name.",".$base,"branch",true);
+        $ldap->copy_FAI_resource_recursive($baseToUse,"ou=".$name.",".$baseToUse,"branch",true);
         
         $this->dispNewBranch = false; 
       }
@@ -392,11 +397,16 @@ class faiManagement extends plugin
         /* Create it know */
         $ldap = $this->config->get_ldap_link();
 
-        $ldap->cd ("ou=".$name.",".$base);
+        $baseToUse = $base;
+        if($_SESSION['faifilter']['branch']!="main"){
+          $baseToUse = $_SESSION['faifilter']['branch'];
+        }
+        
+        $ldap->cd ("ou=".$name.",".$baseToUse);
         $ldap->recursive_remove();
         
         $ldap->cd ($this->config->current['BASE']);
-        $ldap->copy_FAI_resource_recursive($base,"ou=".$name.",".$base,"freeze",true);
+        $ldap->copy_FAI_resource_recursive($baseToUse,"ou=".$name.",".$baseToUse,"freeze",true);
         
         $this->dispNewFreeze = false; 
       }
@@ -776,7 +786,7 @@ class faiManagement extends plugin
       
       if((isset($attrs['ou']))&&($attrs['dn']!=$base)){
         $ret[$attrs['dn']]= $prefix.$attrs['ou'][0];
-        $ret = array_merge($ret,$this->getBranches($attrs['dn'],$prefix."/".$attrs['ou'][0]));
+        $ret = array_merge($ret,$this->getBranches($attrs['dn'],$prefix.$attrs['ou'][0]."/"));
       }
     }
     return($ret);