X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fclass_userinfo.inc;h=783b66822fe500558313f1ca8a27c726243f02a5;hb=b868e20368d036501ec2c97c67bc8362e00753cb;hp=c25cab419498e8b671e6b7b7c846b075b242af85;hpb=c199bfbb3c1206b7d7e4d40f35538a923301c2cf;p=gosa.git diff --git a/include/class_userinfo.inc b/include/class_userinfo.inc index c25cab419..783b66822 100644 --- a/include/class_userinfo.inc +++ b/include/class_userinfo.inc @@ -97,6 +97,31 @@ 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(); + + if(isset($attrs['gosaAclTemplate'])){ + 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); @@ -182,6 +207,11 @@ class userinfo continue; } + if($subacl['type'] == "role") { + echo "role skipped"; + continue; + } + /* Per attribute ACL? */ if (isset($subacl['acl'][$object][$attribute])){ $acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attribute]); @@ -256,6 +286,11 @@ class userinfo } } + /* Load departments here, if we are using php4 */ + if(is_php4() && !count($this->config->departments)){ + $this->config->get_departments(); + } + /* For all gosaDepartments */ foreach ($this->config->departments as $dn){ $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => ""); @@ -286,6 +321,11 @@ class userinfo $acl= $this->cleanACL($acl, TRUE); continue; } + + if($subacl['type'] == 'role'){ + echo "role skipped"; + continue; + } /* Per object ACL? */ foreach ($objects as $object){