From f9e2a15ea3578c6c86efef30a0c8ebededefbb9e Mon Sep 17 00:00:00 2001 From: hickert Date: Mon, 23 Apr 2007 13:09:50 +0000 Subject: [PATCH] Initial role resolve. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6174 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_userinfo.inc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index 9ceefc964..8268e57b5 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -97,6 +97,28 @@ class userinfo $aclc[$attrs['dn']]= $ol; } + /* Resolve roles here. + */ + foreach($aclc as $dn => $data){ + foreach($data as $prio => $aclc_value) { + if($aclc_value['type'] == "role"){ + + unset($aclc[$dn][$prio]); + + $ldap->cat($aclc_value['acl'],array("gosaAclTemplate")); + $attrs = $ldap->fetch(); + for($i= 0; $i<$attrs['gosaAclTemplate']['count']; $i++){ + $tmp = @acl::explodeAcl($attrs['gosaAclTemplate'][$i]); + + foreach($tmp as $new_acl){ + $new_acl['members'] = $aclc_value['members']; + $aclc[$dn][] =$new_acl; + } + } + } + } + } + /* ACL's read, sort for tree depth */ asort($aclp); -- 2.30.2