From 514c630e8c8cd425aeac7568ff862f80a9207784 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 31 Aug 2006 04:15:08 +0000 Subject: [PATCH] Fixed divlist for groups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4547 594d385d-05f5-0310-b6e9-bd551577e9d8 --- plugins/admin/groups/class_divListGroup.inc | 60 ++++++++++++++++----- 1 file changed, 47 insertions(+), 13 deletions(-) diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index ffac98134..e3bf0ca57 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -79,15 +79,34 @@ class divListGroup extends MultiSelectWindow 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("groups"); + + $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.= ""; + } } } - if($this->parent->CopyPasteHandler){ + /* Get copy & paste icon */ + if(preg_match("/w/",$ui->get_permissions($this->selectedBase,"groups/group")) && $this->parent->CopyPasteHandler){ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon(); }else{ $Copy_Paste =""; @@ -102,8 +121,14 @@ class divListGroup extends MultiSelectWindow "  ". "  "; $listhead .= $this->get_snapshot_header($this->selectedBase); - $listhead.="  ". - $Copy_Paste. + + $acls = $ui->get_permissions($this->selectedBase,"groups/group"); + if(preg_match("/c/",$acls)) { + $listhead.="  "; + } + + $listhead.= $Copy_Paste. "  ". _("Base")." ". " %s"; + $ui = get_userinfo(); + // Test Every Entry and generate divlist Array foreach($groups as $key => $val){ /* Create action icons - copy & paste icons */ $actions= ""; - if($this->parent->CopyPasteHandler){ + if(($this->parent->CopyPasteHandler) && preg_match("/w/",$ui->get_category_permissions($val['dn'],"group"))){ $actions.= " "; $actions.= " "; } - $actions.= ""; + + if(preg_match("/r/",$ui->get_category_permissions($val['dn'],"groups"))){ + $actions.= ""; + } + $actions.= $this->GetSnapShotActions($val['dn']); - $actions.= ""; + + if(preg_match("/d/",$ui->get_permissions($val['dn'],"groups/group"))){ + $actions.= ""; + } $posix=$mail=$samba=$appl=$phone=$enviro=$empty; -- 2.30.2