Bug #9437: Fix language selection via login screen
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 21 Dec 2010 22:10:38 +0000 (15:10 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 21 Dec 2010 22:10:45 +0000 (15:10 -0700)
framework/Core/lib/Horde/Core/Auth/Application.php
framework/Core/lib/Horde/Registry.php

index ca1ada1..06d8ba2 100644 (file)
@@ -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 &&
index 900a2fe..484f6d2 100644 (file)
@@ -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
      * </pre>
      */
     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);
     }
 
     /**