From: cajus Date: Fri, 12 Oct 2007 11:51:16 +0000 (+0000) Subject: Added first test for get_module_permissions X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;ds=sidebyside;h=0f15917499d74d505450581173d95ada9400c10d;p=gosa.git 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 --- 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){