From 60f6a9244ed40bd41c31b76369281d2161105854 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 21 Dec 2010 15:23:11 -0700 Subject: [PATCH] More tweaks to language selection on login screen --- horde/login.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/horde/login.php b/horde/login.php index e1fd79f33..7fcad92d3 100644 --- a/horde/login.php +++ b/horde/login.php @@ -94,6 +94,13 @@ case Horde_Auth::REASON_LOGOUT: break; } +/* Change language. */ +if (!$is_auth && + !$prefs->isLocked('language') && + ($new_lang = Horde_Util::getGet('new_lang'))) { + $registry->setLanguageEnvironment($new_lang); +} + if ($logout_reason) { if ($is_auth) { try { @@ -106,8 +113,6 @@ if ($logout_reason) { $is_auth = null; } - $language = $prefs->getValue('language'); - $entry = sprintf('User %s [%s] logged out of Horde', $registry->getAuth(), $_SERVER['REMOTE_ADDR']); Horde::logMessage($entry, 'NOTICE'); $registry->clearAuth(); @@ -124,10 +129,9 @@ if ($logout_reason) { } $session->setup(); - $registry->setLanguageEnvironment($language, $vars->app); - /* Hook to preselect the correct language in the widget. */ - $_GET['new_lang'] = $language; + /* Explicitly set language in un-authenticated session. */ + $registry->setLanguage($GLOBALS['language']); } elseif (Horde_Util::getPost('login_post') || Horde_Util::getPost('login_button')) { /* Get the login params from the login screen. */ @@ -178,8 +182,6 @@ if ($logout_reason) { $entry = sprintf('FAILED LOGIN for %s [%s] to Horde', $vars->horde_user, $_SERVER['REMOTE_ADDR']); Horde::logMessage($entry, 'ERR'); -} elseif ($new_lang = Horde_Util::getGet('new_lang')) { - $registry->setLanguageEnvironment($new_lang); } /* Build the list of necessary login parameters. @@ -253,12 +255,10 @@ if (!empty($conf['auth']['alternate_login'])) { /* Build the