From 7135b3fda8b7ab49b1f69010202f240ec5f3737c Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 25 Jun 2008 12:22:13 +0000 Subject: [PATCH] Added option to skip self acls in get_module_departments(). - git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11439 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_pluglist.inc | 2 +- gosa-core/include/class_userinfo.inc | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 54b5c6764..ecc77a18c 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -113,7 +113,7 @@ class pluglist { /* No self acls. Check if we have any acls for the given ACL type */ - $deps = $this->ui->get_module_departments($acl_to_check); + $deps = $this->ui->get_module_departments($acl_to_check,TRUE); if(count($deps)) return TRUE; } } diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 83db453bf..65cdfdfd9 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -426,7 +426,7 @@ class userinfo /* Extract all departments that are accessible (direct or 'on the way' to an accessible department) */ - function get_module_departments($module) + function get_module_departments($module, $skip_self_acls = FALSE ) { /* If we are forced to skip ACLs checks for the current user @@ -474,6 +474,11 @@ class userinfo foreach($infos as $info){ $found = FALSE; foreach($info['acl'] as $cat => $data){ + + /* Skip self acls? + */ + if($skip_self_acls && preg_match("//s",$data['0'])) continue; + if(is_array($module)){ foreach($module as $mod){ if(preg_match("/^".normalizePreg($mod)."/",$cat)){ -- 2.30.2