forked from extern/egroupware
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');
|
$accounts = CreateObject('phpgwapi.accounts');
|
||||||
$prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid']));
|
$prefs = CreateObject('phpgwapi.preferences', $accounts->name2id($_COOKIE['last_loginid']));
|
||||||
|
|
||||||
if (! $prefs->account_id)
|
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
|
|
||||||
{
|
{
|
||||||
$GLOBALS['phpgw_info']['user']['preferences'] = $prefs->read_repository();
|
$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,
|
// If the lastloginid cookies isn't set, we will default to the first language,
|
||||||
// the users browser accepts.
|
// the users browser accepts.
|
||||||
list($lang) = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
|
list($lang) = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
$lang = substr($lang,0,2);
|
if (strlen($lang) > 2)
|
||||||
if(strlen($lang) != 2) $lang="en";
|
{
|
||||||
|
$lang = substr($lang,0,2);
|
||||||
|
}
|
||||||
$GLOBALS['phpgw_info']['user']['preferences']['common']['lang'] = $lang;
|
$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('login');
|
||||||
$GLOBALS['phpgw']->translation->add_app('loginscreen');
|
$GLOBALS['phpgw']->translation->add_app('loginscreen');
|
||||||
if (lang('loginscreen_message') == 'loginscreen_message*')
|
if (lang('loginscreen_message') == 'loginscreen_message*')
|
||||||
|
@ -48,6 +48,11 @@
|
|||||||
$this->userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
|
$this->userlang = $GLOBALS['phpgw_info']['user']['preferences']['common']['lang'];
|
||||||
}
|
}
|
||||||
$this->add_app('common');
|
$this->add_app('common');
|
||||||
|
if (!count($GLOBALS['lang']))
|
||||||
|
{
|
||||||
|
$this->userlang = 'en';
|
||||||
|
$this->add_app('common');
|
||||||
|
}
|
||||||
$this->add_app($GLOBALS['phpgw_info']['flags']['currentapp']);
|
$this->add_app($GLOBALS['phpgw_info']['flags']['currentapp']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user