diff --git a/include/functions.inc b/include/functions.inc
index 5358c6f097ac7d0a780ecc27bff3e7a487ee3b0a..19e897ea87153d3487e02e76694a2eff534b3055 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
require_once ("class_config.inc");
require_once ("class_userinfo.inc");
require_once ("class_plugin.inc");
+require_once ("class_dhcpPlugin.inc");
require_once ("class_pluglist.inc");
require_once ("class_tabs.inc");
require_once ("class_mail-methods.inc");
function get_browser_language()
{
/* Try to use users primary language */
+ global $config;
$ui= get_userinfo();
if ($ui != NULL){
if ($ui->language != ""){
}
}
+ /* Try to use users primary language */
+ if ($ui != NULL){
+ if ($ui->language != ""){
+ return ($ui->language.".UTF-8");
+ }
+ }
+
/* Load supported languages */
$gosa_languages= get_languages();
}
-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){
@@ -2514,17 +2541,30 @@ function get_languages($languages_in_own_language = FALSE,$strip_region_tag = FA
"sv_SE" => "Swedish",
"zh_CN" => "Chinese",
"ru_RU" => "Russian");
+
+ $tmp2= array(
+ "de_DE" => _("German"),
+ "fr_FR" => _("French"),
+ "it_IT" => _("Italian"),
+ "es_ES" => _("Spanish"),
+ "en_US" => _("English"),
+ "nl_NL" => _("Dutch"),
+ "pl_PL" => _("Polish"),
+ "sv_SE" => _("Swedish"),
+ "zh_CN" => _("Chinese"),
+ "ru_RU" => _("Russian"));
$ret = array();
if($languages_in_own_language){
+
$old_lang = setlocale(LC_ALL, 0);
foreach($tmp as $key => $name){
$lang = $key.".UTF-8";
setlocale(LC_ALL, $lang);
if($strip_region_tag){
- $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name)." (".$name.")";
+ $ret[preg_replace("/^([^_]*).*$/","\\1",$key)] = _($name)." (".$tmp2[$key].")";
}else{
- $ret[$key] = _($name)." (".$name.")";
+ $ret[$key] = _($name)." (".$tmp2[$key].")";
}
}
setlocale(LC_ALL, $old_lang);