X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Fplugins%2Fadmin%2Facl%2Fclass_divListACL.inc;h=5d78f82b3d30000c07e2858003745b4df334ab23;hb=dc7547fdb80a615660085bd6fa7d168c727a59b6;hp=f1e92b2f9e2da4693cc17f75c8f2160569246dd8;hpb=645f88d4feb970b4bb1cd54e7e5a26b5f7966ce5;p=gosa.git diff --git a/gosa-core/plugins/admin/acl/class_divListACL.inc b/gosa-core/plugins/admin/acl/class_divListACL.inc index f1e92b2f9..5d78f82b3 100644 --- a/gosa-core/plugins/admin/acl/class_divListACL.inc +++ b/gosa-core/plugins/admin/acl/class_divListACL.inc @@ -42,7 +42,7 @@ class divListACL extends MultiSelectWindow function divListACL (&$config, &$parent) { - MultiSelectWindow::MultiSelectWindow($config, "ACL", array("acl","aclroles")); + MultiSelectWindow::MultiSelectWindow($config, "ACL", array("acl","acl")); $this->parent = &$parent; $this->ui = get_userinfo(); @@ -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"); @@ -192,11 +141,12 @@ class divListACL extends MultiSelectWindow $action = ""; + /* Handle ACL role entries + */ if(in_array("gosaRole",$acl_entry['objectClass'])){ - /* Role handling */ - $acl = $this->ui->get_permissions($acl_entry['dn'],"aclroles/aclRole"); - $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"aclroles"); + $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/aclrole"); + $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl"); $editlink = "%s"; $list_left_icon = ""._("Role").""; @@ -207,7 +157,7 @@ class divListACL extends MultiSelectWindow } /* Add copy & cut functionality */ - $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"aclroles","aclRole"); + $action.= $this->parent->get_copypaste_action($acl_entry['dn'],"acl","aclRole"); /* Add actions depending on acls */ if(preg_match("/r/", $acl)){ @@ -216,38 +166,37 @@ class divListACL extends MultiSelectWindow } /* Add snapshot functionality */ - $action.= $this->parent->get_snapshot_action($acl_entry['dn'],"aclroles"); - - if(preg_match("/d/", $acl)){ - $action.= ""; - } - - $field0 = array("string" => "" , - "attach" => "style='width:20px;'"); + $action.= $this->parent->get_snapshot_action($acl_entry['dn'],"acl"); }else{ + /* Handle non-role ACL entries */ $acl = $this->ui->get_permissions($acl_entry['dn'],"acl/acl"); $acl_all = $this->ui->has_complete_category_acls($acl_entry['dn'],"acl"); /* Acl handling */ $editlink = "%s"; $list_left_icon = ""._("ACL").""; - $cn = htmlentities(utf8_decode($acl_entry['dn'])); + $cn = preg_replace('/\\\\,/', ',', LDAP::fix($acl_entry['dn'])); /* Add actions depending on acls */ if(preg_match("/r/", $acl)){ $action.= ""; } - if(preg_match("/d/", $acl)){ - $action.= ""; - } - $field0 = array("string" => "", "attach" => "style='width:20px;'"); } + /* Add delete actions */ + if(preg_match("/d/", $acl)){ + $action.= ""; + } + + /* Add a checkbox in front of each entry + */ + $field0 = array("string" => "" , + "attach" => "style='width:20px;'"); + /* Cutted objects should be displayed in light grey */ $display = $cn; if($this->parent->CopyPasteHandler){ @@ -259,13 +208,17 @@ class divListACL extends MultiSelectWindow } } - $field1 = array("string" => $list_left_icon, "attach"=> "style='text-align:center;width:20px;'"); - $field2 = array("string" => sprintf($editlink,$key,$display)." ","attach" => ""); - $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), "attach"=> "style='text-align:right;width:".$this->action_col_size."px;border-right:0px;'"); + $field1 = array("string" => $list_left_icon, + "attach"=> "style='text-align:center;width:20px;'"); + $field2 = array("string" => sprintf($editlink,$key,$display)." ", + "attach" => ""); + $field3 = array("string" => preg_replace("/%KEY%/",$key,$action), + "attach"=> "style='text-align:right;width:".$this->action_col_size."px;border-right:0px;'"); $this->AddElement(array($field0,$field1,$field2,$field3)); } } + function Save() { MultiSelectWindow :: Save();