Code

Added Strict Unit Tag Filter for ACL
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jul 2007 08:33:22 +0000 (08:33 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 11 Jul 2007 08:33:22 +0000 (08:33 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@6826 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_userinfo.inc

index 77003f9e706d8bfeb1571e87f51aba54d3808492..0715c700889cf8fd52a10fc31f1bb2d79a4b5705 100644 (file)
@@ -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)))");
     }