Code

Closes #296 Language settings from gosa.conf wasnt used. IE Detection works here.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Dec 2007 06:34:40 +0000 (06:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 5 Dec 2007 06:34:40 +0000 (06:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@8003 594d385d-05f5-0310-b6e9-bd551577e9d8

include/functions.inc

index 216d04149622acf0d9f3d91c8af0d0bda9908378..e46df87dc7a07c11b7368d555570b5ee383e7344 100644 (file)
@@ -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 */