diff options
author | Mark Weiman <mark.weiman@markzz.com> | 2017-01-20 07:16:40 +0100 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2017-01-20 23:20:51 +0100 |
commit | 7ff50701903017b3b97ca3ca176e923769cdad43 (patch) | |
tree | b86c19012a1b8c2c76631d7b9ebd3982e4728ad8 /web/lib/acctfuncs.inc.php | |
parent | 608c48309084e4048d8226c3f7e363b240248040 (diff) | |
download | aur-7ff50701903017b3b97ca3ca176e923769cdad43.tar.gz aur-7ff50701903017b3b97ca3ca176e923769cdad43.tar.xz |
Update cookie for language setting when editing user information
Currently, when a user edits their language setting from the edit user form,
the changes aren't reflected until the user either lets the original cookie
expire, deletes the cookie manually, or changes the language a second time via
the dropdown menu on the top of the page. This patch makes the language cookie
get updated when it is changed from the edit user form.
Signed-off-by: Mark Weiman <mark.weiman@markzz.com>
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/acctfuncs.inc.php')
-rw-r--r-- | web/lib/acctfuncs.inc.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index b7288143..08dbc671 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -376,6 +376,13 @@ function process_account_form($TYPE,$A,$U="",$T="",$S="",$E="",$H="",$P="",$C="" setcookie("AURTZ", $TZ, $cookie_time, "/"); } + if (isset($_COOKIE["AURLANG"]) && ($_COOKIE["AURLANG"] != $L)) { + /* set new cookie for language */ + $timeout = intval(config_get("options", "persistent_cookie_timeout")); + $cookie_time = time() + $timeout; + setcookie("AURLANG", $L, $cookie_time, "/"); + } + if ($result === false || $ssh_key_result === false) { $message = __("No changes were made to the account, %s%s%s.", "<strong>", htmlspecialchars($U,ENT_QUOTES), "</strong>"); |