Code

Updated acl stuff
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Apr 2010 12:42:08 +0000 (12:42 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 22 Apr 2010 12:42:08 +0000 (12:42 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17792 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_acl.inc
gosa-core/plugins/generic/references/class_aclResolver.inc

index e7ba343fd6e269d8092f37ecbd686e24673a2ea5..455a55ea2d431d878a02c8093fbbc28005ea7566 100644 (file)
@@ -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();
index 45b61156033e265ae8f56ed627722c719bfdd5dc..978b248d22386a1642cde3d1fcac041630a4a569 100644 (file)
@@ -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 <tr class='acl-viewer-head %s'>".
                 "\n  <td>%s</td>".
@@ -119,6 +123,7 @@ class aclResolver
                 "\n  <td colspan=3><hr></td>".
                 "\n </tr>";
 
+            // If the acl consists of a user-object-filter then this template is used.        
             $filter_tpl = 
                 "\n <tr class='%s'>".
                 "\n  <td></td>".
@@ -126,6 +131,7 @@ class aclResolver
                 "\n  <td><ul><li>%s</li></ul></td>".
                 "\n </tr>";
 
+            // Used to display ACL owner of type "group"
             $gmem_tpl = 
                 "\n <tr class='%s'>".
                 "\n  <td></td>".
@@ -133,6 +139,7 @@ class aclResolver
                 "\n  <td><ul>%s</ul></td>".
                 "\n </tr>";
 
+            // Used to display ACL owner of type "user"
             $umem_tpl = 
                 "\n <tr class='%s'>".
                 "\n  <td></td>".
@@ -140,6 +147,7 @@ class aclResolver
                 "\n  <td><ul>%s</ul></td>".
                 "\n </tr>";
 
+            // Used to display the acl contents, except 'reset' and 'role'
             $acl_tpl = 
                 "\n <tr class='%s'>".
                 "\n  <td></td>".
@@ -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?