From: hickert Date: Tue, 24 Oct 2006 07:04:47 +0000 (+0000) Subject: Only display allowed bases in overview X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=997222bcf844880fb1a66e52d56e05ef53cd3cc6;p=gosa.git Only display allowed bases in overview git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4922 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/systems/class_divListSystem.inc b/plugins/admin/systems/class_divListSystem.inc index bf73c5504..b2d1dd7b3 100644 --- a/plugins/admin/systems/class_divListSystem.inc +++ b/plugins/admin/systems/class_divListSystem.inc @@ -82,17 +82,47 @@ class divListSystem extends MultiSelectWindow function GenHeader() { - /* Prepare departments, + /* Prepare departments, which are shown in the listbox on top of the listbox */ $options= ""; - foreach ($this->config->idepartments as $key => $value){ - if ($this->selectedBase == $key){ - $options.= ""; - } else { - $options.= ""; + + /* Get all departments within this subtree */ + $base = $this->config->current['BASE']; + $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, + array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH); + + $tmp =array(); + foreach($deps as $dep){ + $tmp[$dep['dn']] = $dep; + } + $deps = $tmp; + + /* Load possible departments */ + $ui= get_userinfo(); + $department = array(); + foreach($this->module as $module){ + + $d = $ui->get_module_departments($module); + foreach($d as $department){ + $departments[$department] = $department; } } + + $ids = $this->config->idepartments; + + foreach($deps as $dep){ + if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $departments)){ + + $value = $ids[$dep['dn']]; + if ($this->selectedBase == $dep['dn']){ + $options.= ""; + } else { + $options.= ""; + } + } + } + $listhead = "
". "  ".