Code

Udpated loggign
[gosa.git] / include / class_userinfo.inc
index c25cab419498e8b671e6b7b7c846b075b242af85..783b66822fe500558313f1ca8a27c726243f02a5 100644 (file)
@@ -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){