From 3143b4fd380294097dfba0bc1a3f3f51cca27715 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 22 Apr 2010 12:42:08 +0000 Subject: [PATCH] Updated acl stuff git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17792 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_acl.inc | 4 ++-- .../generic/references/class_aclResolver.inc | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index e7ba343fd..455a55ea2 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -1183,8 +1183,8 @@ class acl extends plugin } /* ACL's if needed */ + $final.= ":"; if ($entry['type'] != "reset" && $entry['type'] != "role"){ - $acl= ":"; if (isset($entry['acl'])){ foreach ($entry['acl'] as $object => $contents){ @@ -1217,7 +1217,7 @@ class acl extends plugin } $tmp_acl[]= $final; - } + } /* Call main method */ plugin::save(); diff --git a/gosa-core/plugins/generic/references/class_aclResolver.inc b/gosa-core/plugins/generic/references/class_aclResolver.inc index 45b611560..978b248d2 100644 --- a/gosa-core/plugins/generic/references/class_aclResolver.inc +++ b/gosa-core/plugins/generic/references/class_aclResolver.inc @@ -72,19 +72,22 @@ class aclResolver function reload() { - - // Go through all ACLs and get those matching out DN. + // Go through all ACLs and get those matching the objects dn. $ui = get_userinfo(); $ui->reset_acl_cache(); $ui->loadACL(); foreach($ui->allACLs as $dn => $acls){ if(preg_match("/".preg_quote($dn,'/')."$/i", $this->dn)){ + + // Foreach dn there is a collection of ACLs indexed by their priority foreach($acls as $prio => $acl){ if($acl['type'] == "reset"){ $this->affectingACLs[$dn][$prio] = $acl; continue; }else{ + + // Only get those entries with a relevant acl-category foreach($acl['acl'] as $category => $attributes){ if(preg_match("/^all($|\/)/", $category) || preg_match("/^".$this->acl_category."($|\/)/", $category)){ @@ -109,6 +112,7 @@ class aclResolver { if(empty($this->renderedList)){ + // Base template - each entry start with this $tpl = "\n ". "\n %s". @@ -119,6 +123,7 @@ class aclResolver "\n
". "\n "; + // If the acl consists of a user-object-filter then this template is used. $filter_tpl = "\n ". "\n ". @@ -126,6 +131,7 @@ class aclResolver "\n ". "\n "; + // Used to display ACL owner of type "group" $gmem_tpl = "\n ". "\n ". @@ -133,6 +139,7 @@ class aclResolver "\n ". "\n "; + // Used to display ACL owner of type "user" $umem_tpl = "\n ". "\n ". @@ -140,6 +147,7 @@ class aclResolver "\n ". "\n "; + // Used to display the acl contents, except 'reset' and 'role' $acl_tpl = "\n ". "\n ". @@ -155,7 +163,11 @@ class aclResolver foreach($this->affectingACLs as $dn => $acls){ foreach($acls as $acl){ $gmem = $umem = $defs = ""; + + // Prepare entry icon (department or element?) $image = (isset($this->config->idepartments[$dn]))? "images/select_department.png":"images/lists/element.png"; + + // The acl type (sub,psub,reset...) $aclType = $this->aclTypes[$acl['type']]; // Does the filter match for current object? -- 2.30.2