Code

Updated department handling for the rootDSE entry.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jul 2008 06:42:31 +0000 (06:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 2 Jul 2008 06:42:31 +0000 (06:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11503 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/plugins/admin/departments/class_departmentGeneric.inc
gosa-core/plugins/admin/departments/country.tpl
gosa-core/plugins/admin/departments/dcObject.tpl
gosa-core/plugins/admin/departments/generic.tpl
gosa-core/plugins/admin/departments/locality.tpl
gosa-core/plugins/admin/departments/organization.tpl

index eec9adf02ce43d5b9d99100d8578e65fd61ddef3..d6cd8e31dfb8cd66e158e8fa94235268373129f9 100644 (file)
@@ -107,18 +107,20 @@ class department extends plugin
                $this->config->make_idepartments();
                $smarty= get_smarty();
 
-    /* Hide base selector, if this object represents the base itself 
-     */
-    $smarty->assign("hide_base", FALSE);
-    if($this->dn == $this->config->current['BASE']){
-      $smarty->assign("hide_base", TRUE);
-    }
-
     $tmp = $this->plInfo();
     foreach($tmp['plProvidedAcls'] as $name => $translation){
       $smarty->assign($name."ACL",$this->getacl($name));
     }
 
+    /* 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));
+    }
+
                /* Base select dialog */
                $once = true;
                foreach($_POST as $name => $value){
@@ -228,7 +230,12 @@ class department extends plugin
        /* Save data to object */
        function save_object()
        {
-               if (isset($_POST['dep_generic_posted'])){
+    if (isset($_POST['dep_generic_posted'])){
+
+      $nA = $this->namingAttr;
+      $old_nA = $this->$nA;
+
+
 
       /* Create a base backup and reset the
          base directly after calling plugin::save_object();
@@ -253,6 +260,13 @@ class department extends plugin
           $this->is_administrational_unit= false;
         }
       }
+
+      /* If this is the root directory service entry (rootDSE)
+         then avoid changing the naming attribute of this entry.
+       */
+      if($this->dn == $this->config->current['BASE']){
+        $this->$nA = $old_nA;
+      }
     }
        }
 
index be7717f243ff911abfe385a03cd328df45adeee8..ca2d4992696970d068df1099f7b05532c384b00d 100644 (file)
@@ -23,7 +23,7 @@
 {/render}
        </td>
       </tr>
-       {if !$hide_base}
+       {if !$is_root_dse}
       <tr>
         <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
         <td>
index 92465f0d9814db01956d4ca446761502d7e48b29..70b9a1d904dfa60ab9c6a02bf0713ef28ff3c815 100644 (file)
@@ -23,7 +23,7 @@
 {/render}
        </td>
       </tr>
-       {if !$hide_base}
+       {if !$is_root_dse}
       <tr>
         <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
         <td>
index bfc135ed7a8b0083f4704303f2229f0bec9c2a75..5a90e01f28ddaa433264df8328baa4cd9952822a 100644 (file)
@@ -34,7 +34,7 @@
       <tr>
         <td colspan="2"><br></td>
       </tr>
-       {if !$hide_base}
+       {if !$is_root_dse}
       <tr>
         <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
 
index d3715757d3d01535825cd5c1db4081dbdf836e8e..62a3816e5e63c2d33d3e05e610674484968cdee6 100644 (file)
@@ -23,7 +23,7 @@
 {/render}
        </td>
       </tr>
-       {if !$hide_base}
+       {if !$is_root_dse}
       <tr>
         <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>
         <td>
index 2b2563be33ea966860533ae351651cecb72d4e07..88a761214b09482d9d7c7d61d20b6eefd081f0b7 100644 (file)
@@ -34,7 +34,7 @@
       <tr>
         <td colspan="2"><br></td>
       </tr>
-       {if !$hide_base}
+       {if !$is_root_dse}
       <tr>
         <td><LABEL for="base">{t}Base{/t}</LABEL>{$must}</td>