From: hickert Date: Wed, 2 Jul 2008 06:42:31 +0000 (+0000) Subject: Updated department handling for the rootDSE entry. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=46e5854a4fc9e9ed72276149b64ee8399abdb7d9;p=gosa.git Updated department handling for the rootDSE entry. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11503 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index eec9adf02..d6cd8e31d 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -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; + } } } diff --git a/gosa-core/plugins/admin/departments/country.tpl b/gosa-core/plugins/admin/departments/country.tpl index be7717f24..ca2d49926 100644 --- a/gosa-core/plugins/admin/departments/country.tpl +++ b/gosa-core/plugins/admin/departments/country.tpl @@ -23,7 +23,7 @@ {/render} - {if !$hide_base} + {if !$is_root_dse} {$must} diff --git a/gosa-core/plugins/admin/departments/dcObject.tpl b/gosa-core/plugins/admin/departments/dcObject.tpl index 92465f0d9..70b9a1d90 100644 --- a/gosa-core/plugins/admin/departments/dcObject.tpl +++ b/gosa-core/plugins/admin/departments/dcObject.tpl @@ -23,7 +23,7 @@ {/render} - {if !$hide_base} + {if !$is_root_dse} {$must} diff --git a/gosa-core/plugins/admin/departments/generic.tpl b/gosa-core/plugins/admin/departments/generic.tpl index bfc135ed7..5a90e01f2 100644 --- a/gosa-core/plugins/admin/departments/generic.tpl +++ b/gosa-core/plugins/admin/departments/generic.tpl @@ -34,7 +34,7 @@
- {if !$hide_base} + {if !$is_root_dse} {$must} diff --git a/gosa-core/plugins/admin/departments/locality.tpl b/gosa-core/plugins/admin/departments/locality.tpl index d3715757d..62a3816e5 100644 --- a/gosa-core/plugins/admin/departments/locality.tpl +++ b/gosa-core/plugins/admin/departments/locality.tpl @@ -23,7 +23,7 @@ {/render} - {if !$hide_base} + {if !$is_root_dse} {$must} diff --git a/gosa-core/plugins/admin/departments/organization.tpl b/gosa-core/plugins/admin/departments/organization.tpl index 2b2563be3..88a761214 100644 --- a/gosa-core/plugins/admin/departments/organization.tpl +++ b/gosa-core/plugins/admin/departments/organization.tpl @@ -34,7 +34,7 @@
- {if !$hide_base} + {if !$is_root_dse} {$must}