From: Michael M Slusarz Date: Tue, 21 Dec 2010 22:10:38 +0000 (-0700) Subject: Bug #9437: Fix language selection via login screen X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=f8eb4531db2bacffbff430b8774e1fb16350cd2e;p=horde.git Bug #9437: Fix language selection via login screen --- diff --git a/framework/Core/lib/Horde/Core/Auth/Application.php b/framework/Core/lib/Horde/Core/Auth/Application.php index ca1ada1e6..06d8ba240 100644 --- a/framework/Core/lib/Horde/Core/Auth/Application.php +++ b/framework/Core/lib/Horde/Core/Auth/Application.php @@ -562,6 +562,9 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base return true; } + /* Grab the current language before we destroy the session. */ + $language = $registry->preferredLang(); + /* Destroy any existing session on login and make sure to use a * new session ID, to avoid session fixation issues. */ if (!$registry->getAuth()) { @@ -579,7 +582,8 @@ class Horde_Core_Auth_Application extends Horde_Auth_Base $registry->setAuth($userId, $credentials, array( 'app' => $this->_app, - 'change' => $this->getCredential('change') + 'change' => $this->getCredential('change'), + 'language' => $language )); if ($this->_base && diff --git a/framework/Core/lib/Horde/Registry.php b/framework/Core/lib/Horde/Registry.php index 900a2fef8..484f6d268 100644 --- a/framework/Core/lib/Horde/Registry.php +++ b/framework/Core/lib/Horde/Registry.php @@ -2060,6 +2060,8 @@ class Horde_Registry * 'change' - (boolean) Whether to request that the user change their * password. * DEFAULT: No + * 'language' - (string) The preferred language. + * DEFAULT: null * */ public function setAuth($authId, $credentials, array $options = array()) @@ -2095,7 +2097,7 @@ class Horde_Registry $GLOBALS['injector']->getInstance('Horde_Core_Factory_Prefs')->clearCache(); $this->loadPrefs(); - $this->setLanguageEnvironment($GLOBALS['prefs']->getValue('language'), $app); + $this->setLanguageEnvironment(isset($options['language']) ? $options['language'] : null, $app); } /**