From: hickert Date: Wed, 22 Jun 2011 05:52:22 +0000 (+0000) Subject: Added new listing property which allows to disable ACLs checks for the current listing. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d87639d209b47e23b16d88026668ac9177f79001;p=gosa.git Added new listing property which allows to disable ACLs checks for the current listing. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@20904 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_filterNOACL.inc b/gosa-core/include/class_filterNOACL.inc new file mode 100644 index 000000000..e3c59eff3 --- /dev/null +++ b/gosa-core/include/class_filterNOACL.inc @@ -0,0 +1,16 @@ +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; + } +} + +?> diff --git a/gosa-core/include/class_listing.inc b/gosa-core/include/class_listing.inc index 5d8e6069c..71b1665ab 100644 --- a/gosa-core/include/class_listing.inc +++ b/gosa-core/include/class_listing.inc @@ -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; } }