From f6b34b434dfe3ac4208ede802ed28935b27c1010 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 Jun 2008 11:21:31 +0000 Subject: [PATCH] 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@11368 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../plugins/admin/acl/class_divListACL.inc | 53 +----------------- .../admin/groups/class_divListGroup.inc | 55 +------------------ .../admin/ogroups/class_divListOGroup.inc | 44 +-------------- .../admin/users/class_divListUsers.inc | 52 +----------------- 4 files changed, 5 insertions(+), 199 deletions(-) diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc index f1e92b2f9..dcf6b6498 100644 --- a/gosa-core/plugins/admin/acl/class_divListACL.inc +++ b/gosa-core/plugins/admin/acl/class_divListACL.inc @@ -87,61 +87,10 @@ class divListACL extends MultiSelectWindow function GenHeader() { - /* Prepare departments, - which are shown in the listbox on top of the listbox - */ - $options= ""; - $Copy_Paste = ""; - /* Get all departments within this subtree */ $ui= get_userinfo(); - $first = ""; - $found = FALSE; $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("acl"); - $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); /* Allow copy & paste for roles */ $acl_all = $ui->has_complete_category_acls($this->selectedBase,"acl"); diff --git a/gosa-core/plugins/admin/groups/class_divListGroup.inc b/gosa-core/plugins/admin/groups/class_divListGroup.inc index aef997275..d47541f31 100644 --- a/gosa-core/plugins/admin/groups/class_divListGroup.inc +++ b/gosa-core/plugins/admin/groups/class_divListGroup.inc @@ -104,69 +104,16 @@ class divListGroup extends MultiSelectWindow function GenHeader() { - /* Prepare departments, - which are shown in the listbox on top of the listbox - */ - $options= ""; - - - /* Get all departments within this subtree */ $ui= get_userinfo(); $first = ""; $found = FALSE; $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("groups"); - $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 */ $acl = $ui->get_permissions($this->selectedBase,"groups/group"); - /* Add default header */ $listhead = MultiSelectWindow::get_default_header(); diff --git a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc index 424859bc1..3e828b68f 100644 --- a/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_divListOGroup.inc @@ -118,16 +118,12 @@ class divListOGroup extends MultiSelectWindow function GenHeader() { - /* Prepare departments, - which are shown in the listbox on top of the listbox - */ - $options= ""; - /* Get all departments within this subtree */ $ui= get_userinfo(); $first = ""; $found = FALSE; $base = $this->config->current['BASE']; + $options = $this->create_department_list($this->module); /* Add base */ $tmp = array(); @@ -135,44 +131,6 @@ class divListOGroup extends MultiSelectWindow $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("ogroups"); - $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; - } - /* Add a seperator after displaying c&p and snapshot icons ? */ $add_sep = false; diff --git a/gosa-core/plugins/admin/users/class_divListUsers.inc b/gosa-core/plugins/admin/users/class_divListUsers.inc index 61aacad3f..8541df457 100644 --- a/gosa-core/plugins/admin/users/class_divListUsers.inc +++ b/gosa-core/plugins/admin/users/class_divListUsers.inc @@ -99,60 +99,12 @@ class divListUsers 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("users"); - $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 copy & paste icon */ + $ui = get_userinfo(); $acl = $ui->get_permissions($this->selectedBase,"users/user"); $acl_all = $ui->has_complete_category_acls($this->selectedBase,"users"); -- 2.30.2