From: hickert Date: Thu, 19 Jun 2008 11:22:41 +0000 (+0000) Subject: Updated Listing for serveral Management lists. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=443548acbdded029dc91d838031fe9c349c1136f;p=gosa.git Updated Listing for serveral Management lists. -Departments were only listed if we have full access. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11373 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc index 9e05b7da3..1cec74ea0 100644 --- a/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc +++ b/gosa-plugins/gofon/gofon/conference/class_divListConferences.inc @@ -68,61 +68,13 @@ class divListConference extends MultiSelectWindow function GenHeader() { - /* Prepare departments, - which are shown in the listbox on top of the listbox - */ - $options= ""; - /* Get all departments within this subtree */ $base = $this->config->current['BASE']; - - /* Add base */ - $tmp = array(); - $tmp[] = array("dn"=>$this->config->current['BASE']); - $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, - array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); - - $deps = array(); - foreach($tmp as $tm){ - $deps[$tm['dn']] = $tm['dn']; - } - - /* Load possible departments */ - $ui= get_userinfo(); - $tdeps= $ui->get_module_departments("gofonconference"); - $ids = $this->config->idepartments; - $first = ""; - $found = FALSE; - foreach($ids as $dep => $name){ - if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ - - /* Keep first base dn in mind, we could need this - * info if no valid base was found - */ - if(empty($first)) { - $first = $dep['dn']; - } - - $value = $ids[$dep]; - if ($this->selectedBase == $dep){ - $found = TRUE; - $options.= ""; - } else { - $options.= ""; - } - } - } - - /* The currently used base is not visible with your acl setup. - * Set base to first useable base. - */ - if(!$found){ - $this->selectedBase = $first; - } + $options = $this->create_department_list($this->module); /* Get acls */ - $acls = $ui->get_permissions($this->selectedBase,"gofonconference/conference"); - $acl_all = $ui->has_complete_category_acls($this->selectedBase,"gofonconference") ; + $acls = $this->ui->get_permissions($this->selectedBase,"gofonconference/conference"); + $acl_all = $this->ui->has_complete_category_acls($this->selectedBase,"gofonconference") ; /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); diff --git a/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc b/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc index 172e636d1..25791bdea 100644 --- a/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc +++ b/gosa-plugins/gofon/gofon/macro/class_divListMacros.inc @@ -66,60 +66,11 @@ class divListMacro extends MultiSelectWindow function GenHeader() { - /* Prepare departments, - which are shown in the listbox on top of the listbox - */ - $options= ""; - /* Get all departments within this subtree */ $base = $this->config->current['BASE']; - $first = ""; - $found = FALSE; - - /* Add base */ - $tmp = array(); - $tmp[] = array("dn"=>$this->config->current['BASE']); - $tmp= array_merge($tmp,get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", $this->module, $base, - array("ou", "description"), GL_SIZELIMIT | GL_SUBSEARCH)); - - $deps = array(); - foreach($tmp as $tm){ - $deps[$tm['dn']] = $tm['dn']; - } - - /* Load possible departments */ - $ui= get_userinfo(); - $tdeps= $ui->get_module_departments("gofonmacro"); - $ids = $this->config->idepartments; - $first = ""; - $found = FALSE; - foreach($ids as $dep => $name){ - if(isset($deps[$dep]) && in_array_ics($dep, $tdeps)){ - - /* Keep first base dn in mind, we could need this - * info if no valid base was found - */ - if(empty($first)) { - $first = $dep['dn']; - } - - $value = $ids[$dep]; - if ($this->selectedBase == $dep){ - $found = TRUE; - $options.= ""; - } else { - $options.= ""; - } - } - } - - /* The currently used base is not visible with your acl setup. - * Set base to first useable base. - */ - if(!$found){ - $this->selectedBase = $first; - } + $options = $this->create_department_list($this->module); + $ui =get_userinfo(); $acl = $ui->get_permissions($this->selectedBase,"gofonmacro/macro"); $acl_all= $ui->has_complete_category_acls($this->selectedBase,"gofonmacro");