From: hickert Date: Mon, 26 May 2008 05:52:19 +0000 (+0000) Subject: Added additional acl filter condition. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=63c674664e628f21496bfde29223fac14d0f0443;p=gosa.git Added additional acl filter condition. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10993 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_acl.inc b/gosa-core/include/class_acl.inc index faeac2698..c1f24d707 100644 --- a/gosa-core/include/class_acl.inc +++ b/gosa-core/include/class_acl.inc @@ -326,12 +326,17 @@ class acl extends plugin if ($aclDialog && $this->aclObject != "" && is_array($this->ocMapping[$this->aclObject])){ foreach ($this->ocMapping[$this->aclObject] as $oc){ - unset($this->aclContents[$oc]); - unset($this->aclContents[$this->aclObject.'/'.$oc]); - if (isset($new_acl[$oc])){ + + if(isset($this->aclContents[$oc]) && is_array($this->aclContents)){ + unset($this->aclContents[$oc]); + unset($this->aclContents[$this->aclObject.'/'.$oc]); + }else{ +# trigger_error("Huhm?"); + } + if (isset($new_acl[$oc]) && is_array($new_acl)){ $this->aclContents[$oc]= $new_acl[$oc]; } - if (isset($new_acl[$this->aclObject.'/'.$oc])){ + if (isset($new_acl[$this->aclObject.'/'.$oc]) && is_array($new_acl)){ $this->aclContents[$this->aclObject.'/'.$oc]= $new_acl[$this->aclObject.'/'.$oc]; } } diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 013fa048f..a2e5eb632 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -259,31 +259,28 @@ class userinfo continue; } -# /* With user filter */ -# $sdn = preg_replace("/^[^,]*+,/","",$dn); -# if (isset($subacl['filter']) && !empty($subacl['filter'])){ -# -# $ldap->cd($sdn); -# $ldap->ls($subacl['filter'],$sdn); -# if(!$ldap->count()){ -# continue; -# }else{ -# $found = FALSE; -# while($attrs = $ldap->fetch()){ -# echo $attrs['dn']."
"; -# if($attrs['dn'] == $dn){ -# $found = TRUE; -# echo $acl."
";; -# break; -# } -# } -# if(!$found){ -# continue; -# } -# } -# } - - /* Per attribute ACL? */ + /* 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]); continue;