From 8aa84e1a1f4d20bcb133c7542965f3cee0b98ee4 Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 19 Jun 2008 10:11:45 +0000 Subject: [PATCH] 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 --- gosa-core/include/class_pluglist.inc | 12 +-------- gosa-core/include/class_userinfo.inc | 39 ++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 11 deletions(-) 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" => ""); -- 2.30.2