From 8360d37cb7a5cab0f344c317946a7774ef1eb4f8 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 10 Jan 2006 16:31:11 +0000 Subject: [PATCH] Some updates for branch git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@2438 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/fai/class_askClassName.inc | 5 ++--- plugins/admin/fai/class_faiManagement.inc | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/plugins/admin/fai/class_askClassName.inc b/plugins/admin/fai/class_askClassName.inc index a5bddcd7f..13b923a8b 100644 --- a/plugins/admin/fai/class_askClassName.inc +++ b/plugins/admin/fai/class_askClassName.inc @@ -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(); diff --git a/plugins/admin/fai/class_faiManagement.inc b/plugins/admin/fai/class_faiManagement.inc index 42438f6dd..17971a305 100644 --- a/plugins/admin/fai/class_faiManagement.inc +++ b/plugins/admin/fai/class_faiManagement.inc @@ -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); -- 2.30.2