From: hickert Date: Tue, 24 Oct 2006 06:53:41 +0000 (+0000) Subject: Only display allowed bases X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=30a1a3e3d450aa62cbaa8dbfdb4b6aac5ca274a2;p=gosa.git Only display allowed bases git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4921 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/fai/class_divListFai.inc b/plugins/admin/fai/class_divListFai.inc index 9dea993f8..7707658b3 100644 --- a/plugins/admin/fai/class_divListFai.inc +++ b/plugins/admin/fai/class_divListFai.inc @@ -95,20 +95,35 @@ class divListFai extends MultiSelectWindow function GenHeader() { - $ui = get_userinfo(); /* 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); + + /* Load possible departments */ + $ui= get_userinfo(); + $tdeps= $ui->get_module_departments("fai"); + + $ids = $this->config->idepartments; + + foreach($deps as $dep){ + if(isset($ids[$dep['dn']]) && in_array_ics($dep['dn'], $tdeps)){ + + $value = $ids[$dep['dn']]; + if ($this->selectedBase == $dep['dn']){ + $options.= ""; + } else { + $options.= ""; + } } } - /* Create listhead, it will be shown on top of the divlist. + /* Create listhead, it will be shown on top of the divlist. * It provides general navigation and object creation */ $listhead =