From 8d4541c317038eb4e074fc77d62f23344dfe971c Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 22 Apr 2010 12:20:58 +0000 Subject: [PATCH] Updated filter handling git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17791 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../generic/references/class_aclResolver.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gosa-core/plugins/generic/references/class_aclResolver.inc b/gosa-core/plugins/generic/references/class_aclResolver.inc index 1ba56b5b3..45b611560 100644 --- a/gosa-core/plugins/generic/references/class_aclResolver.inc +++ b/gosa-core/plugins/generic/references/class_aclResolver.inc @@ -8,11 +8,20 @@ class aclResolver private $renderedList = ""; + // The users 'dn' and 'uid' used to verify the collected acls + private $validateDn; + private $validateUid; + function __construct($config, $dn, $parent) { $this->config = &$config; $this->dn = $dn; + // Replace this with a user defined one later. + $ui = get_userinfo(); + $this->validateUid = $ui->uid; + $this->validateDn = $ui->dn; + // Get ACL category for the current object. if(isset($parent->acl_category) && !empty($parent->acl_category)){ $this->acl_category = preg_replace("/\/$/","",$parent->acl_category); @@ -149,11 +158,11 @@ class aclResolver $image = (isset($this->config->idepartments[$dn]))? "images/select_department.png":"images/lists/element.png"; $aclType = $this->aclTypes[$acl['type']]; - // Does the filter match for us? + // Does the filter match for current object? $filter =""; $match = TRUE; if(!empty($acl['filter'])){ - $match = $ldap->object_match_filter($ui->dn,$acl['filter']); + $match = $ldap->object_match_filter($this->dn,$acl['filter']); $filter= $acl['filter']; if(!$match){ $filter= "".$filter.""; @@ -164,7 +173,7 @@ class aclResolver if($match){ $found = FALSE; foreach($acl['members'] as $mem => $desc){ - if($mem == "U:{$ui->dn}"){ + if($mem == "U:{$this->validateDn}"){ $found = TRUE; break; } @@ -177,7 +186,7 @@ class aclResolver $ldap->cat($gdn,array('memberUid')); if($ldap->count()){ $attrs = $ldap->fetch(); - if(isset($attrs['memberUid']) && in_array($ui->uid, $attrs['memberUid'])){ + if(isset($attrs['memberUid']) && in_array($this->validateUid, $attrs['memberUid'])){ $found = TRUE; } } -- 2.30.2