From: hickert Date: Wed, 5 Dec 2007 06:34:40 +0000 (+0000) Subject: Closes #296 Language settings from gosa.conf wasnt used. IE Detection works here. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=0b41dcb31c6b6ae7817cbb4a136a573c17e81869;p=gosa.git Closes #296 Language settings from gosa.conf wasnt used. IE Detection works here. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8003 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/functions.inc b/include/functions.inc index 216d04149..e46df87dc 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -153,17 +153,19 @@ function get_browser_language() /* Try to use users primary language */ global $config; $ui= get_userinfo(); - if ($ui != NULL){ + if (isset($ui) && $ui !== NULL){ if ($ui->language != ""){ return ($ui->language.".UTF-8"); } } - /* Try to use users primary language */ - if ($ui != NULL){ - if ($ui->language != ""){ - return ($ui->language.".UTF-8"); + /* Check for global language settings in gosa.conf */ + if(isset($config->data['MAIN']['LANG']) && !empty($config->data['MAIN']['LANG'])) { + $lang = $config->data['MAIN']['LANG']; + if(!preg_match("/utf/i",$lang)){ + $lang .= ".UTF-8"; } + return($lang); } /* Load supported languages */