Code

Initial role resolve.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 23 Apr 2007 13:09:50 +0000 (13:09 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 23 Apr 2007 13:09:50 +0000 (13:09 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@6174 594d385d-05f5-0310-b6e9-bd551577e9d8

include/class_userinfo.inc

index 9ceefc964318b6a2d37c606be882ca94e8ab27cf..8268e57b57eb80f9d58a2f5cc330be58fa7c77ff 100644 (file)
@@ -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);