Code

Updated department classes to allow to modify the rootDSE, but not to move it.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 12:31:15 +0000 (12:31 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 17 Mar 2010 12:31:15 +0000 (12:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@16749 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_department.inc
gosa-core/plugins/admin/departments/tabs_department.inc

index 9e817d55dbb92d319e5e205b2c1d836581d7ad61..277f6e674370b03e88966c8a819ec37a8ab6fe2c 100644 (file)
@@ -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();
index 1c37179d2517d4737cbe51ebafff3339ccf76be8..6d80aef4dec7e7e273f7ea4427dd0b15f6df45ed 100644 (file)
@@ -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);