From 1e6e0e7c70bef372e78941a3a2b0cd2a515d63fb Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 17 Mar 2010 12:31:15 +0000 Subject: [PATCH] Updated department classes to allow to modify the rootDSE, but not to move it. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16749 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../admin/departments/class_department.inc | 18 ++++++++++++------ .../admin/departments/tabs_department.inc | 5 +++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/gosa-core/plugins/admin/departments/class_department.inc b/gosa-core/plugins/admin/departments/class_department.inc index 9e817d55d..277f6e674 100644 --- a/gosa-core/plugins/admin/departments/class_department.inc +++ b/gosa-core/plugins/admin/departments/class_department.inc @@ -55,12 +55,15 @@ class department extends plugin var $initially_was_tagged = false; var $orig_base = ""; var $orig_ou = ""; + var $orig_dn = ""; var $baseSelector; var $manager_enabled = FALSE; var $manager_name =""; var $manager =""; + var $is_root_dse = FALSE; + function department (&$config, $dn) { /* Add the default structural obejct class 'locality' if this is a new entry @@ -111,6 +114,12 @@ class department extends plugin $this->base= preg_replace ("/^[^,]+,/", "", $this->dn); } + // Special handling for the rootDSE + if($this->dn == $this->config->current['BASE']){ + $this->base = $this->dn; + $this->is_root_dse = TRUE; + } + $this->orig_base = $this->base; /* Is administrational Unit? */ @@ -207,12 +216,9 @@ class department extends plugin /* Hide base selector, if this object represents the base itself */ - $smarty->assign("is_root_dse", FALSE); - if($this->dn == $this->config->current['BASE']){ - $smarty->assign("is_root_dse", TRUE); - $nA = $this->namingAttr."ACL"; - $smarty->assign($nA,$this->getacl($this->namingAttr,TRUE)); - } + $smarty->assign("is_root_dse", $this->is_root_dse); + $nA = $this->namingAttr."ACL"; + $smarty->assign($nA,$this->getacl($this->namingAttr,TRUE)); /* Hide all departments, that are subtrees of this department */ $bases = $this->get_allowed_bases(); diff --git a/gosa-core/plugins/admin/departments/tabs_department.inc b/gosa-core/plugins/admin/departments/tabs_department.inc index 1c37179d2..6d80aef4d 100644 --- a/gosa-core/plugins/admin/departments/tabs_department.inc +++ b/gosa-core/plugins/admin/departments/tabs_department.inc @@ -60,6 +60,11 @@ class deptabs extends tabs $nAV = preg_replace('/"/', '\"', $nAV); $new_dn = @LDAP::convert($namingAttr.'='.$nAV.','.$baseobject->base); + // Do not try to move the root DSE + if($baseobject->is_root_dse){ + $new_dn = $baseobject->orig_dn; + } + /* Move group? */ if ($this->dn != $new_dn && $this->dn != "new"){ $baseobject->move($this->dn,$new_dn); -- 2.30.2