Summary | Language selection at login fails |
Queue | Horde Base |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | slusarz (at) horde (dot) org |
Requester | rsalmon (at) mbpgroup (dot) com |
Created | 12/08/2010 (5300 days ago) |
Due | |
Updated | 12/23/2010 (5285 days ago) |
Assigned | 12/22/2010 (5286 days ago) |
Resolved | 12/23/2010 (5285 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
problems with that, except that this is the way it has been forever
(at least in H3).
list in the same order like we have in Horde 3.
HTTP_ACCEPT_LANGUAGE. At least in NLS::select().
Horde_Registry::preferredLang() is all. I support the idea that
locking the preference prevents language changing, but that should be
handled in the login UI.
selection in the login screen and the browser's preferred language
should have precedence over the default preference value, that's
what we did in H3.
Though now that I think about it, this would be the only way an
admin could set a default language for all users without having to
lock it at the same time.
And maybe I'm reading you wrong, but the login screen language (or
browser detection) is used as the language as long as the 'language'
preference is empty. But once the 'language' preference is filled
with a language, to me that is indication by the admin/user that this
is the canonical language to use, despite the login screen indication.
And we can't hide the language selection on login based on this
value since we don't know what that value is for any given user.
Bug #9437: Change language regardless of POST/GEThttp://git.horde.org/horde-git/-/commit/893cb996233774ceec8499844c6f8d973a210ef7
only look for/use variable 'new_lang' set in $_GET and not $_POST.
But the login form uses method POST.
changed regardless of the GET/POST status. e.g you switch language
and try to login unsuccessfully - when the login screen reloads, the
language should be switched.
field when reloading the page, and we don't want to lose the entered
credentials either.
language, even if the page hasn't been reloaded.
I haven't looked at the code, but it looks like the login process only
look for/use variable 'new_lang' set in $_GET and not $_POST. But the
login form uses method POST.
If either username or password isn't empty => NOK.
when reloading the page, and we don't want to lose the entered
credentials either.
If fields username and password are empty when changing language => OK.
If either username or password isn't empty => NOK.
Thanks.
problems with that, except that this is the way it has been forever
(at least in H3).
in the same order like we have in Horde 3.
is a preference value. Its locked status does not change the value;
language. If we have a different way now to do this that doesn't
stretch the semantic of a locked preference, even better.
selection in the login screen and the browser's preferred language
should have precedence over the default preference value, that's what
we did in H3.
Though now that I think about it, this would be the only way an admin
could set a default language for all users without having to lock it
at the same time.
Bug #9437: Last fallback should be nlsconfig default languagehttp://git.horde.org/horde-git/-/commit/c38ad90cc7788025f6e7a42e1d06bb5b36574d62
I always get to : return basename($GLOBALS['session']->get('horde',
'language')) => fr_FR
destroyed when logging in so this value MUST be empty. This value is
initially set in Horde_Registry::setLanguage() (line 2234) so maybe
you should check there.
I always get to : return basename($GLOBALS['session']->get('horde',
'language')) => fr_FR
$lang is always null/empty.
Calls to function preferredLang don't have any argument. That's
probably why $lang is always empty.
#grep preferredLang -r /var/www/html/horde
libs/Horde/Registry.php: public function preferredLang($lang = null)
libs/Horde/Registry.php: $lang = $this->preferredLang();
libs/Horde/Core/Ui/Language.php: $session->set('horde',
'language', $registry->preferredLang());
libs/Horde/Core/Auth/Application.php: $language =
$registry->preferredLang();
services/language.php:$session->set('horde', 'language',
$registry->preferredLanguage(Horde_Util::getForm('new_lang')));
Note that the login language selection will NEVER work if the user
has a 'language' prefs value set.
I'll try to look at Horde_Registry::preferredLang()
problems with that, except that this is the way it has been forever
(at least in H3).
I do have an issue with this though:
a preference value. Its locked status does not change the value;
locking only influences whether the preference value can be *changed*.
When determining the preferred language, if there is a value set for
the 'language' preference, whether it is locked or not or whether it
is the default user or an actual user, it doesn't matter. All that
matters is that a value exists and it is not blank (previously, this
was broken - if the preference was locked but set to blank, we would
skip all other determinations and default to en_US which is surely not
what is wanted).
For example, an admin could set a default language in the prefs, but
keep it unlocked, and a guest user could theoretically go in and
change this value in the prefs. The default value should be used
until that happens though - it shouldn't be ignored.
1. Default preference, if locked.
2. Language will be set based on language drop-down on login refresh
(if language switching allowed)
3. Session language is used (pre-auth session will have language set
if the login screen has been reloaded)
4. Finally, browser detection.
5. System-wide default used (nls config)
screen language selection)
2. Language from login screen will be used (if language switching allowed)
On initial login session is new/clean; language info unavailable here
On subsequent login, this contains the session language (code will
ALWAYS stop here after user is authenticated)
3. Finally, browser detection.
4. System-wide default used (nls config)
State ⇒ Feedback
Note that the login language selection will NEVER work if the user has
a 'language' prefs value set.
Ticket #9437: Tweak preferred language selection.I *think* this should be the behavior (precedence-wise):
Pre-auth
--------
Prefs will most likely be unavailable or default language is empty.
Language will be set based on language drop-down on login refresh (if
language switching allowed)
Session language is used (pre-auth session will have language set if the
login screen has been reloaded)
System-wide default used (nls config)
Finally, browser detection.
Post-auth
---------
Value in user's prefs will ALWAYS control (regardless of login screen
language selection)
Language from login screen will be used (if language switching allowed)
On initial login session is new/clean; language info unavailable here
On subsequent login, this contains the session language (code will
ALWAYS stop here after user is authenticated)
System-wide default used (nls config)
Finally, browser detection.
http://git.horde.org/horde-git/-/commit/f3e1f1c153b3c70a21748bba366e81a1a1dfe594
Need a trace ? Where can I look ?
if clause if it is working properly.
Bug #9437: Fix language selection via login screenhttp://git.horde.org/horde-git/-/commit/f8eb4531db2bacffbff430b8774e1fb16350cd2e
Need a trace ? Where can I look ?
State ⇒ Resolved
Assigned to Michael Slusarz
always calling setLanguageEnvironment() after set the authentication
credentials with the value of the user's language preference.
Instead, we want to grab the language information from the
non-authenticated session and set to this value (if possible) in order
to match the login screen.
Bug #9437: Fix language selection via login screenhttp://git.horde.org/horde-git/-/commit/f8eb4531db2bacffbff430b8774e1fb16350cd2e
State ⇒ Feedback
login screen. Does this fix your problem?
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Language selection at login fails
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
$conf['auth']['params']['app'] = 'imp';
I use Firefox 3.6.12
about:config => intl.accept_languages = "fr, fr-fr,en-us, en"
No matter what language I select, Horde always log me in using the
French language.
If I change Firefox 's setting to intl.accept_languages = "en-us,
en,fr, fr-fr", Horde will always appear in english.