mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
fixed prob with login-scree-message and no cookie
This commit is contained in:
parent
d26cfa20e9
commit
060311ab7d
24
login.php
24
login.php
@ -254,29 +254,25 @@
|
||||
$accounts = CreateObject('phpgwapi.accounts');
|
||||
$prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid']));
|
||||
|
||||
if (! $prefs->account_id)
|
||||
{
|
||||
// Default to the first language, the users browser accepts.
|
||||
list($lang) = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
|
||||
$lang = substr($lang,0,2);
|
||||
if(strlen($lang) != 2) $lang="en";
|
||||
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
|
||||
}
|
||||
else
|
||||
if ($prefs->account_id)
|
||||
{
|
||||
$GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository();
|
||||
}
|
||||
#print 'LANG:' . $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '<br>';
|
||||
}
|
||||
else
|
||||
if (!isset($_COOKIE['last_loginid']) || !$prefs->account_id)
|
||||
{
|
||||
// If the lastloginid cookies isn't set, we will default to the first language,
|
||||
// the users browser accepts.
|
||||
list($lang) = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
|
||||
$lang = substr($lang,0,2);
|
||||
if(strlen($lang) != 2) $lang="en";
|
||||
list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
if (strlen($lang) > 2)
|
||||
{
|
||||
$lang = substr($lang,0,2);
|
||||
}
|
||||
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
|
||||
}
|
||||
#print 'LANG:' . $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] . '<br>';
|
||||
|
||||
$GLOBALS['phpgw']->translation->init(); // this will set the language according to the (new) set prefs
|
||||
$GLOBALS['phpgw']->translation->add_app('login');
|
||||
$GLOBALS['phpgw']->translation->add_app('loginscreen');
|
||||
if (lang('loginscreen_message') == 'loginscreen_message*')
|
||||
|
@ -48,6 +48,11 @@
|
||||
$this->userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
|
||||
}
|
||||
$this->add_app('common');
|
||||
if (!count($GLOBALS['lang']))
|
||||
{
|
||||
$this->userlang = 'en';
|
||||
$this->add_app('common');
|
||||
}
|
||||
$this->add_app($GLOBALS['phpgw_info']['flags']['currentapp']);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user