Code

Aded workaround for -- Per Object ACLS.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Jun 2008 10:11:45 +0000 (10:11 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 19 Jun 2008 10:11:45 +0000 (10:11 +0000)
Is not working as expected, old behaviour should be the same.

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11367 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_pluglist.inc
gosa-core/include/class_userinfo.inc

index 1b311a778dba2502f1957e87df306c7c3bbeb2a2..095620859bb274fa94c9980fad2961105ff08d62 100644 (file)
@@ -91,17 +91,7 @@ class pluglist {
 
                foreach($acls_to_check as $acl_to_check){
                        $deps = $this->ui->get_module_departments($acl_to_check);
-                       foreach($deps as $dep){
-                               if(preg_match("/\//",$acl_to_check)){
-                                       if($this->ui->get_permissions($dep,$acl_to_check) != ""){
-                                               return(TRUE);
-                                       }
-                               }else{
-                                       if($this->ui->get_category_permissions($dep,$acl_to_check) != ""){
-                                               return(TRUE);
-                                       }
-                               }
-                       }
+                       if(count($deps)) return TRUE;
                }
                return (FALSE);
        }
index 9ce014935a932ba0eaad49a9ef035ed63deab054..07a0c367deba18cf295f9574ab76ac3db14a8195 100644 (file)
@@ -448,6 +448,45 @@ class userinfo
       }
     }
 
+    
+
+    /* Search for per object ACLs. 
+     */
+    $this->config->get_departments();
+    $this->config->make_idepartments();
+
+    print_a(array("DATA " => $module));
+
+    foreach($this->ACL as $dn => $infos){
+      foreach($infos as $info){
+        $found = FALSE;
+        foreach($info['acl'] as $cat => $data){
+          if(is_array($module)){
+            foreach($module as $mod){
+              if(preg_match("/^".normalizePreg($mod)."/",$cat)){
+                $found =TRUE;
+                break;
+              }
+            }
+          }else{
+            if(preg_match("/^".normalizePreg($module)."/",$cat)){
+              $found =TRUE;
+              break;
+            }
+          }
+        } 
+
+        if($found && !isset($this->config->idepartments[$dn])){
+          while(!isset($this->config->idepartments[$dn]) && preg_match("/,/",$dn)){
+            $dn = preg_replace("/^[^,]+,/","",$dn);
+          }
+          if(isset($this->config->idepartments[$dn])){
+            $deps[] = $dn;
+          }
+        }
+      }
+    }
+
     /* For all gosaDepartments */
     foreach ($this->config->departments as $dn){
       $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");