aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/user.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2014-05-02 21:23:58 +0200
committerNils Adermann <naderman@naderman.de>2014-05-02 21:23:58 +0200
commit0fc6b6ac369e56ce648c808447ce8ec311f91a89 (patch)
treeebd074f95e93e2859d392bcdd7296b0c19c38414 /phpBB/phpbb/user.php
parent03594b64438464ba7f234ce38d3344561bc0a66b (diff)
parent5b0b0d7c66ecd6f5d77726b635c3d6625caf56d7 (diff)
downloadforums-0fc6b6ac369e56ce648c808447ce8ec311f91a89.tar
forums-0fc6b6ac369e56ce648c808447ce8ec311f91a89.tar.gz
forums-0fc6b6ac369e56ce648c808447ce8ec311f91a89.tar.bz2
forums-0fc6b6ac369e56ce648c808447ce8ec311f91a89.tar.xz
forums-0fc6b6ac369e56ce648c808447ce8ec311f91a89.zip
Merge remote-tracking branch 'github-vse/ticket/12254' into develop-ascraeus
* github-vse/ticket/12254: [ticket/12254] Add subsilver2 support for cookie storage instead of SID [ticket/12254] Use a cookie instead of SID to store language selection [ticket/12254] No longer need to add change_lang to the URL params [ticket/12254] Use 'language' instead of 'set_lang' as the variable name [ticket/12254] Persist set_lang after reg only if changed from default [ticket/12254] Add set_lang var changes to subsilver2 files [ticket/12254] Use new set_lang var to avoid conflict with change_lang [ticket/12254] Stop using deprecated request_var in user class [ticket/12254] Better language switching on registration page
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r--phpBB/phpbb/user.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 18b7a3d096..2f186593ec 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -69,7 +69,7 @@ class user extends \phpbb\session
*/
function setup($lang_set = false, $style_id = false)
{
- global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
+ global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
global $phpbb_dispatcher;
if ($this->data['user_id'] != ANONYMOUS)
@@ -80,7 +80,17 @@ class user extends \phpbb\session
}
else
{
- $user_lang_name = basename($config['default_lang']);
+ $change_lang = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE);
+ if ($change_lang)
+ {
+ $use_lang = basename($change_lang);
+ $user_lang_name = (file_exists($this->lang_path . $use_lang . "/common.$phpEx")) ? $use_lang : basename($config['default_lang']);
+ $this->data['user_lang'] = $user_lang_name;
+ }
+ else
+ {
+ $user_lang_name = basename($config['default_lang']);
+ }
$user_date_format = $config['default_dateformat'];
$user_timezone = $config['board_timezone'];
@@ -190,7 +200,7 @@ class user extends \phpbb\session
}
unset($lang_set_ext);
- $style_request = request_var('style', 0);
+ $style_request = $request->variable('style', 0);
if ($style_request && (!$config['override_user_style'] || $auth->acl_get('a_styles')) && !defined('ADMIN_START'))
{
global $SID, $_EXTRA_URL;