From b9ecd74d0807db08b8a7a30f09b66ee0a61df078 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 11 Jul 2007 08:33:22 +0000 Subject: [PATCH] Added Strict Unit Tag Filter for ACL git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6826 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_userinfo.inc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 77003f9e7..0715c7008 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -65,14 +65,21 @@ class userinfo { $ldap= $this->config->get_ldap_link(); + /* Check if we should include the unittag */ + $tag= ""; + if ($this->gosaUnitTag != "" && isset($this->config->current['STRICT_UNITS']) && + preg_match('/TRUE/i', $this->config->current['STRICT_UNITS'])){ + $tag= "(gosaUnitTag=".$this->gosaUnitTag.")"; + } + /* Load ACL's from all groups we're in */ $this->subtreeACL= array(); $ldap->cd($this->config->current['BASE']); if ($this->gidNumber == -1){ - $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaObject)". + $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaObject)".$tag. "(memberUid=$this->username))"); } else { - $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaObject)". + $ldap->search("(&(objectClass=posixGroup)(objectClass=gosaObject)".$tag. "(|(memberUid=$this->username)(gidNumber=$this->gidNumber)))"); } -- 2.30.2