From: hickert Date: Mon, 26 Apr 2010 15:44:42 +0000 (+0000) Subject: Updated aclResolver. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=79a4ea6e0b4e90dac6df73ab4466b8614327f5b2;p=gosa.git Updated aclResolver. -Fixed member detection git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@17854 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/generic/references/class_aclResolver.inc b/gosa-core/plugins/generic/references/class_aclResolver.inc index 59dc2bf1d..ab8fe53ba 100644 --- a/gosa-core/plugins/generic/references/class_aclResolver.inc +++ b/gosa-core/plugins/generic/references/class_aclResolver.inc @@ -216,14 +216,14 @@ class aclResolver // Check membership $gmem = $umem = ""; $users = $groups = array(); - $gfound = $ufound = FALSE; + $found = FALSE; foreach($acl['members'] as $type => $name){ // Check if we're part of the members if(preg_match("/^U:/", $type)){ if(preg_match("/^U:".preg_quote($this->validateDn,'/')."/", $type)){ $users[] = $name; - $ufound = TRUE; + $found = TRUE; continue; } $users[] = "".$name.""; @@ -232,7 +232,7 @@ class aclResolver // Check if we're part of the group members if(preg_match("/^G/", $type)){ if($type == "G:*"){ - $gfound = TRUE; + $found = TRUE; $groups[] = $name; continue; } @@ -242,19 +242,17 @@ class aclResolver if($ldap->count()){ $attrs = $ldap->fetch(); if(isset($attrs['memberUid']) && in_array($this->validateUid, $attrs['memberUid'])){ - $gfound = TRUE; + $found = TRUE; $groups[] = $name; continue; } } } - // Group member doesn't mactch + // Mark groups that doesn't match $groups[] = "".$name.""; } } - if(!count($groups)) $gfound = TRUE; - if(!count($users)) $ufound = TRUE; // Build up ACL definition list $defs =""; @@ -270,10 +268,10 @@ class aclResolver // Display the acl block in a special color if its not matching $class=""; - if(!($gfound || $ufound) || !$match){ + if(!$found || !$match){ $class = "acl-viewer-blocked"; } - + $str .= "".$class.""; if(!empty($filter)) $filter =sprintf($filter_tpl,$class,$filter); if(!empty($defs)) $defs = sprintf($acl_tpl,$class,$defs); if(count($users)) $umem = sprintf($umem_tpl,$class,"
  • ".implode($users,'
  • ')."
  • ");