Code

Added new listing property which allows to disable ACLs checks for the current listing.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Jun 2011 05:52:22 +0000 (05:52 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 22 Jun 2011 05:52:22 +0000 (05:52 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20904 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_filterNOACL.inc [new file with mode: 0644]
gosa-core/include/class_listing.inc

diff --git a/gosa-core/include/class_filterNOACL.inc b/gosa-core/include/class_filterNOACL.inc
new file mode 100644 (file)
index 0000000..e3c59ef
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+class filterNOACL extends filterLDAPBlacklist{
+
+  static function query($base, $scope, $filter, $attributes, $category, $objectStorage= array(""))
+  {
+    $config= session::global_get('config');
+    $ldap= $config->get_ldap_link(TRUE);
+    $flag= GL_NO_ACL_CHECK | GL_SIZELIMIT | (($scope == "sub")?GL_SUBSEARCH:0);
+    $result= filterLDAP::get_list($base, $filter, $attributes, $category, $objectStorage, $flag);
+    $result = (filterLDAPBlacklist::filterByBlacklist($result));
+    return $result;
+  }
+}
+
+?>
index 5d8e6069c5f1785b79d642c69a463d3a329f4cbb..71b1665abfed35543e2555dd86181dfb958038b1 100644 (file)
@@ -29,6 +29,7 @@ class listing {
     var $departmentRootVisible= false;
     var $multiSelect= false;
     var $singleSelect= false;
+    var $noAclChecks= false;
     var $template;
     var $headline;
     var $base;
@@ -170,7 +171,7 @@ class listing {
         $this->xmlData= $this->xmlData["list"];
 
         // Load some definition values
-        foreach (array("departmentBrowser", "departmentRootVisible", "multiSelect","singleSelect", "baseMode") as $token) {
+        foreach (array("departmentBrowser", "departmentRootVisible", "multiSelect","singleSelect", "baseMode", "noAclChecks") as $token) {
             if (isset($this->xmlData['definition'][$token]) &&
                     $this->xmlData['definition'][$token] == "true"){
                 $this->$token= true;
@@ -653,18 +654,20 @@ class listing {
         $this->entries= $this->filter->query();
 
         // Check entry acls
-        foreach($this->entries as $row => $entry){
-            $acl = "";
-            $found = false;
-            foreach($this->aclToObjectClass as $category => $ocs){
-                if(count(array_intersect($ocs, $entry['objectClass']))){
-                    $acl .= $ui->get_permissions($entry['dn'],$category, 0);
-                    $found = true;
+        if(!$this->noAclChecks){
+            foreach($this->entries as $row => $entry){
+                $acl = "";
+                $found = false;
+                foreach($this->aclToObjectClass as $category => $ocs){
+                    if(count(array_intersect($ocs, $entry['objectClass']))){
+                        $acl .= $ui->get_permissions($entry['dn'],$category, 0);
+                        $found = true;
+                    }
+                }
+                if(!preg_match("/r/", $acl) && $found){
+                    unset($this->entries[$row]);
+                    continue;
                 }
-            }
-            if(!preg_match("/r/", $acl) && $found){
-                unset($this->entries[$row]);
-                continue;
             }
         }