summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0544610)
raw | patch | inline | side by side (parent: 0544610)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Aug 2007 12:08:52 +0000 (12:08 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 31 Aug 2007 12:08:52 +0000 (12:08 +0000) |
Language string return by get_browser_language() updated.
Return user defined language first, then global and at least the browsers supported language.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7183 594d385d-05f5-0310-b6e9-bd551577e9d8
Return user defined language first, then global and at least the browsers supported language.
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@7183 594d385d-05f5-0310-b6e9-bd551577e9d8
html/index.php | patch | blob | history | |
html/main.php | patch | blob | history | |
include/functions.inc | patch | blob | history | |
plugins/personal/generic/class_user.inc | patch | blob | history |
diff --git a/html/index.php b/html/index.php
index fcd6130849d44c0aceb65e1dc4faa71bcb85afb1..ab9ed3f5c1cb950bfb320171bcdc7e2300d398c6 100644 (file)
--- a/html/index.php
+++ b/html/index.php
/* Check for old files in compile directory */
clean_smarty_compile_dir($smarty->compile_dir);
-/* Language setup */
-if ($config->data['MAIN']['LANG'] == ""){
- $lang= get_browser_language();
-} else {
- $lang= $config->data['MAIN']['LANG'];
-}
+$lang= get_browser_language();
putenv("LANGUAGE=");
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);
diff --git a/html/main.php b/html/main.php
index 0093a965321d4b746ee549820a870b5c127ca0bf..3eb9acca9018e381244149093d967b2cfc044607 100644 (file)
--- a/html/main.php
+++ b/html/main.php
$_SESSION['Last_init_lang'] = get_browser_language();
}
-/* Language setup */
-if ($config->data['MAIN']['LANG'] == ""){
-
- /* If last language != current force navi reload */
- if($_SESSION['Last_init_lang'] != get_browser_language()){
- $reload_navigation = true;
- }
- $lang= get_browser_language();
- $_SESSION['Last_init_lang'] = $lang;
-} else {
- $lang= $config->data['MAIN']['LANG'];
+/* If last language != current force navi reload */
+if($_SESSION['Last_init_lang'] != get_browser_language()){
+ $reload_navigation = true;
}
+$lang= get_browser_language();
+$_SESSION['Last_init_lang'] = $lang;
putenv("LANGUAGE=");
putenv("LANG=$lang");
diff --git a/include/functions.inc b/include/functions.inc
index 5358c6f097ac7d0a780ecc27bff3e7a487ee3b0a..cae474cb80a6e95ba647eb7f2747d790b1400ac9 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.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();
index cd87f29ca964a307247d57580f7f76a10b499780..edf9a4701c33d1a5a932c07a591bcdfcd8d68e02 100644 (file)
/* Finally write data with selected 'mode' */
$this->cleanup();
+
+ if(isset($this->attrs['preferredLanguage'])){
+ $_SESSION['ui']->language = $this->preferredLanguage;
+ $_SESSION['Last_init_lang'] = "update";
+ }
+
$ldap->cd ($this->dn);
$ldap->$mode ($this->attrs);
if (show_ldap_error($ldap->get_error(), _("Saving generic user account failed"))){