index 08e232de746e1c7f0b263c45eac5c3995d2d5d5f..36c5072553e9296ae2ec100b25c9e40d5103ce8f 100644 (file)
var $ocMapping= array();
var $groups= array();
var $result_cache =array();
var $ocMapping= array();
var $groups= array();
var $result_cache =array();
- var $ignoreACl = FALSE;
+ var $ignoreACL = FALSE;
var $ACLperPath = array();
var $ACLperPath_usesFilter = array();
var $ACLperPath = array();
var $ACLperPath_usesFilter = array();
public function reset_acl_cache()
{
/* Initialize ACL_CACHE */
public function reset_acl_cache()
{
/* Initialize ACL_CACHE */
- session::set('ACL_CACHE',array());
+ session::global_set('ACL_CACHE',array());
}
function loadACL()
}
function loadACL()
/* Inspect members... */
foreach ($type['members'] as $grp => $grpdsc){
/* Inspect members... */
foreach ($type['members'] as $grp => $grpdsc){
+
/* Some group inside the members that is relevant for us? */
/* Some group inside the members that is relevant for us? */
- if (in_array_ics(preg_replace('/^G:/', '', $grp), $this->groups)){
+ if (in_array_ics(@LDAP::convert(preg_replace('/^G:/', '', $grp)), $this->groups)){
$interresting= TRUE;
}
$interresting= TRUE;
}
$without_self_acl = $all_acl = array();
foreach($this->ACL as $dn => $acl){
$sdn =$dn;
$without_self_acl = $all_acl = array();
foreach($this->ACL as $dn => $acl){
$sdn =$dn;
- while(strpos($dn,",") !== FALSE){
-
+ $first= TRUE; // Run at least once
+ while(strpos($dn,",") !== FALSE || $first){
+ $first = FALSE;
if(isset($this->ACL[$dn])){
$all_acl[$sdn][$dn] = $this->ACL[$dn];
$without_self_acl[$sdn][$dn] = $this->ACL[$dn];
if(isset($this->ACL[$dn])){
$all_acl[$sdn][$dn] = $this->ACL[$dn];
$without_self_acl[$sdn][$dn] = $this->ACL[$dn];
/* Remove all acl entries which are especially for the current user (self acl)
*/
foreach($acl_set['acl'] as $object => $object_acls){
/* Remove all acl entries which are especially for the current user (self acl)
*/
foreach($acl_set['acl'] as $object => $object_acls){
- if(strpos($object_acls[0],"s")){
+ if(isset($object_acls[0]) && strpos($object_acls[0],"s")){
unset($without_self_acl[$sdn][$dn][$acl_id]['acl'][$object]);
}
}
unset($without_self_acl[$sdn][$dn][$acl_id]['acl'][$object]);
}
}
}
/* Push cache answer? */
}
/* Push cache answer? */
- $ACL_CACHE = &session::get('ACL_CACHE');
+ $ACL_CACHE = &session::global_get('ACL_CACHE');
if (isset($ACL_CACHE["$dn+$object+$attribute"])){
$ret = $ACL_CACHE["$dn+$object+$attribute"];
if($skip_write){
if (isset($ACL_CACHE["$dn+$object+$attribute"])){
$ret = $ACL_CACHE["$dn+$object+$attribute"];
if($skip_write){
/* Self ACLs?
*/
/* Self ACLs?
*/
- if($dn != $this->dn && isset($subacl['acl'][$object][0]) && strpos($subacl['acl'][$object][0],"s")){
+ if($dn != $this->dn && isset($subacl['acl'][$object][0]) && (strpos($subacl['acl'][$object][0],"s") !== FALSE)){
continue;
}
continue;
}
if($attribute == ""){
foreach($this->ocMapping[$ocs] as $oc){
if (isset($subacl['acl'][$ocs.'/'.$oc])){
if($attribute == ""){
foreach($this->ocMapping[$ocs] as $oc){
if (isset($subacl['acl'][$ocs.'/'.$oc])){
+
+ if($dn != $this->dn && strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue;
+
foreach($subacl['acl'][$ocs.'/'.$oc] as $attr => $dummy){
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][$attr]);
}
foreach($subacl['acl'][$ocs.'/'.$oc] as $attr => $dummy){
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][$attr]);
}
}
}else{
if(isset($subacl['acl'][$ocs.'/'.$oc][0])){
}
}else{
if(isset($subacl['acl'][$ocs.'/'.$oc][0])){
+ if($dn != $this->dn && strpos($subacl['acl'][$ocs.'/'.$oc][0],"s") !== FALSE) continue;
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][0]);
}
}
$acl= $this->mergeACL($acl, $subacl['type'], $subacl['acl'][$ocs.'/'.$oc][0]);
}
}
}
/* Use cached results if possilbe */
}
/* Use cached results if possilbe */
- $ACL_CACHE = &session::get('ACL_CACHE');
+ $ACL_CACHE = &session::global_get('ACL_CACHE');
if(!is_array($module)){
$module = array($module);
if(!is_array($module)){
$module = array($module);
foreach($info['acl'] as $cat => $data){
/* Skip self acls? */
foreach($info['acl'] as $cat => $data){
/* Skip self acls? */
- if($skip_self_acls && isset($data['0']) && strpos($data['0'], "s")) continue;
+ if($skip_self_acls && isset($data['0']) && (strpos($data['0'], "s") !== FALSE)) continue;
if(preg_match("/^".preg_quote($mod, '/')."/",$cat)){
$found =TRUE;
break;
if(preg_match("/^".preg_quote($mod, '/')."/",$cat)){
$found =TRUE;
break;
foreach(str_split($newACL) as $char){
foreach(str_split($newACL) as $char){
+ /* Skip "self" ACLs without combination of rwcdm, they have no effect.
+ -self flag without read/write/create/...
+ */
+ if(empty($char)) continue;
+
/* Skip permanent and subtree entries */
if (preg_match('/[sp]/', $acl[$char])){
continue;
/* Skip permanent and subtree entries */
if (preg_match('/[sp]/', $acl[$char])){
continue;