index c1263330cef07987f05014760159e37de477dae1..5413cd00ab4c5784a61f26274dee4a6653fa83aa 100644 (file)
return($ret);
}
+ /* Get ldap object, for later filter checks
+ */
+ $ldap = $this->config->get_ldap_link();
+
$acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");
/* Build dn array */
continue;
}
+ /* With user filter */
+ if (isset($subacl['filter']) && !empty($subacl['filter'])){
+ $sdn = preg_replace("/^[^,]*+,/","",$dn);
+ $ldap->cd($sdn);
+ $ldap->ls($subacl['filter'],$sdn);
+ if(!$ldap->count()){
+ continue;
+ }else{
+ $found = FALSE;
+ while($attrs = $ldap->fetch()){
+ if($attrs['dn'] == $dn){
+ $found = TRUE;
+ break;
+ }
+ }
+ if(!$found){
+ continue;
+ }
+ }
+ }
+
/* Per attribute ACL? */
if (isset($subacl['acl'][$object][$attribute])){
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$object][$attribute]);
/* Assemble string */
$ret= "";
foreach ($acl as $key => $value){
- if ($value != ""){
+ if ($value !== ""){
$ret.= $key;
}
}