From: hickert Date: Thu, 31 Aug 2006 06:43:12 +0000 (+0000) Subject: Some acl fixes for groups X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=926339449603324f5626fecaf91ab26e8856d960;p=gosa.git Some acl fixes for groups git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4551 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/groups/class_divListGroup.inc b/plugins/admin/groups/class_divListGroup.inc index 55704051b..b46e8ee08 100644 --- a/plugins/admin/groups/class_divListGroup.inc +++ b/plugins/admin/groups/class_divListGroup.inc @@ -199,11 +199,8 @@ class divListGroup extends MultiSelectWindow src='images/editcopy.png' alt='"._("copy")."' name='copy_%KEY%' title='"._("Copy this entry")."'> "; } - if(preg_match("/r/",$ui->get_category_permissions($val['dn'],"groups"))){ - $actions.= ""; - } - + $actions.= ""; if(preg_match("/w/",$ui->get_permissions($val['dn'],"groups/group"))){ $actions.= $this->GetSnapShotActions($val['dn']); diff --git a/plugins/admin/ogroups/class_divListOGroup.inc b/plugins/admin/ogroups/class_divListOGroup.inc index 415a6b964..69e6ce207 100755 --- a/plugins/admin/ogroups/class_divListOGroup.inc +++ b/plugins/admin/ogroups/class_divListOGroup.inc @@ -85,15 +85,32 @@ class divListOGroup 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("ogroups"); + + $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,"ogroups/ogroup")) && $this->parent->CopyPasteHandler){ $Copy_Paste = $this->parent->CopyPasteHandler->generatePasteIcon(); }else{ $Copy_Paste =""; @@ -110,10 +127,20 @@ class divListOGroup extends MultiSelectWindow "  ". "  "; - $listhead .= $this->get_snapshot_header($this->selectedBase); - $listhead .=" ". - $Copy_Paste. + + $acls = $ui->get_permissions($this->selectedBase,"ogroups/ogroup"); + if(preg_match("/c/",$acls) && preg_match("/w/",$acls)){ + $listhead .= $this->get_snapshot_header($this->selectedBase); + }else{ + $listhead .= " "; + } + + if(preg_match("/c/",$acls)) { + $listhead .=" "; + } + + $listhead .= $Copy_Paste. "  ". _("Base")." ". " parent->snapshotEnabled()){ $action_col_size += 38; } + + $ui = get_userinfo(); // Assigning ogroups foreach($list as $key => $val){ /* Create action icons */ $actions= ""; - if($this->parent->CopyPasteHandler){ + if($this->parent->CopyPasteHandler && preg_match("/w/",$ui->get_category_permissions($val['dn'],"ogroups"))){ $actions.= " "; $actions.= " "; } + + $actions.= ""; - $actions.= $this->GetSnapShotActions($val['dn']); - $actions.= ""; + + if(preg_match("/w/",$ui->get_permissions($val['dn'],"groups/group"))){ + $actions.= $this->GetSnapShotActions($val['dn']); + } + + if(preg_match("/d/",$ui->get_permissions($val['dn'],"ogroups/ogroup"))) { + $actions.= ""; + }else{ + $action.= " "; + } if(isset($val['mail'])){ diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index 8dafd74e5..0c64897d7 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -156,8 +156,8 @@ class ogroupManagement extends plugin $this->dn= "new"; /* Create new usertab object */ - $this->ogroup= new ogrouptabs($this->config, - $this->config->data['TABS']['OGROUPTABS'], $this->dn); + $this->ogroup= new ogrouptabs($this->config,$this->config->data['TABS']['OGROUPTABS'], $this->dn,"ogroups"); + $this->ogroup->set_acl_base($this->DivListOGroup->selectedBase); } diff --git a/plugins/admin/ogroups/tabs_ogroups.inc b/plugins/admin/ogroups/tabs_ogroups.inc index dbae97bb2..a8944ce26 100644 --- a/plugins/admin/ogroups/tabs_ogroups.inc +++ b/plugins/admin/ogroups/tabs_ogroups.inc @@ -128,10 +128,10 @@ class ogrouptabs extends tabs return ( $str); } - function ogrouptabs($config, $data, $dn) + function ogrouptabs($config, $data, $dn,$category ="") { - tabs::tabs($config, $data, $dn); + tabs::tabs($config, $data, $dn, $category); $this->base= $this->by_object['ogroup']->base; /* Insert extra tabs for several object types - if present */