X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=gosa-core%2Finclude%2Fclass_userinfo.inc;h=36c5072553e9296ae2ec100b25c9e40d5103ce8f;hb=6e04f2e6bcdfe38a342086628aaa1249fb707047;hp=08e232de746e1c7f0b263c45eac5c3995d2d5d5f;hpb=26ed90923dc2292f528c4abb08a8a4ef0fc14b36;p=gosa.git diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 08e232de7..36c507255 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -36,7 +36,7 @@ class userinfo var $ocMapping= array(); var $groups= array(); var $result_cache =array(); - var $ignoreACl = FALSE; + var $ignoreACL = FALSE; var $ACLperPath = array(); var $ACLperPath_usesFilter = array(); @@ -80,7 +80,7 @@ class userinfo public function reset_acl_cache() { /* Initialize ACL_CACHE */ - session::set('ACL_CACHE',array()); + session::global_set('ACL_CACHE',array()); } function loadACL() @@ -158,8 +158,9 @@ class userinfo /* Inspect members... */ foreach ($type['members'] as $grp => $grpdsc){ + /* 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; } @@ -196,8 +197,9 @@ class userinfo $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]; @@ -212,7 +214,7 @@ class userinfo /* 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]); } } @@ -328,7 +330,7 @@ class userinfo } /* 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){ @@ -422,7 +424,7 @@ class userinfo /* 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; } @@ -466,6 +468,9 @@ class userinfo 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]); } @@ -474,6 +479,7 @@ class userinfo } }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]); } } @@ -522,7 +528,7 @@ class userinfo } /* 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); @@ -545,7 +551,7 @@ class userinfo 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; @@ -598,6 +604,11 @@ class userinfo 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;