From: hickert Date: Thu, 19 Jun 2008 10:11:45 +0000 (+0000) Subject: Aded workaround for -- Per Object ACLS. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=8aa84e1a1f4d20bcb133c7542965f3cee0b98ee4;p=gosa.git Aded workaround for -- Per Object ACLS. Is not working as expected, old behaviour should be the same. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11367 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 1b311a778..095620859 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -91,17 +91,7 @@ class pluglist { foreach($acls_to_check as $acl_to_check){ $deps = $this->ui->get_module_departments($acl_to_check); - foreach($deps as $dep){ - if(preg_match("/\//",$acl_to_check)){ - if($this->ui->get_permissions($dep,$acl_to_check) != ""){ - return(TRUE); - } - }else{ - if($this->ui->get_category_permissions($dep,$acl_to_check) != ""){ - return(TRUE); - } - } - } + if(count($deps)) return TRUE; } return (FALSE); } diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 9ce014935..07a0c367d 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -448,6 +448,45 @@ class userinfo } } + + + /* Search for per object ACLs. + */ + $this->config->get_departments(); + $this->config->make_idepartments(); + + print_a(array("DATA " => $module)); + + foreach($this->ACL as $dn => $infos){ + foreach($infos as $info){ + $found = FALSE; + foreach($info['acl'] as $cat => $data){ + if(is_array($module)){ + foreach($module as $mod){ + if(preg_match("/^".normalizePreg($mod)."/",$cat)){ + $found =TRUE; + break; + } + } + }else{ + if(preg_match("/^".normalizePreg($module)."/",$cat)){ + $found =TRUE; + break; + } + } + } + + if($found && !isset($this->config->idepartments[$dn])){ + while(!isset($this->config->idepartments[$dn]) && preg_match("/,/",$dn)){ + $dn = preg_replace("/^[^,]+,/","",$dn); + } + if(isset($this->config->idepartments[$dn])){ + $deps[] = $dn; + } + } + } + } + /* For all gosaDepartments */ foreach ($this->config->departments as $dn){ $acl= array("r" => "", "w" => "", "c" => "", "d" => "", "m" => "", "a" => "");