From 0f15917499d74d505450581173d95ada9400c10d Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 12 Oct 2007 11:51:16 +0000 Subject: [PATCH] Added first test for get_module_permissions git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7536 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/functions.inc | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/include/functions.inc b/include/functions.inc index 05bdfd563..19e897ea8 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -755,9 +755,27 @@ function get_permissions ($dn, $subtreeACL) } -function get_module_permission($acl_array, $module, $dn) -{ - global $ui; +function get_module_permission($acl_array, $module, $dn, $checkTag= TRUE) + global $ui, $config; + + /* Check for strict tagging */ + if ($checkTag && isset($config->current['STRICT_UNITS']) && + preg_match('/^(yes|true)$/i', $config->current['STRICT_UNITS']) && + $ui->gosaUnitTag != ""){ + $size= 0; + foreach ($config->tdepartments as $tdn => $tag){ + if (preg_match("/$tdn$/", $dn)){ + if (strlen($tdn) > $size){ + $ttag= $tag; + } + } + } + + /* We have no permission for areas that don't carry our tag */ + if ($ttag != $ui->gosaUnitTag){ + return ("#none#"); + } + } $final= ""; foreach($acl_array as $acl){ -- 2.30.2