Fix the user settings

- When language is changed, update the menu and translations immediately
- When time zone is changed, update it immediately
- Flush the settings apcu cache if enabled
This commit is contained in:
FusionPBX
2025-10-10 12:01:51 -06:00
committed by GitHub
parent ec852b10f8
commit 435ef38c88
16 changed files with 124 additions and 74 deletions

View File

@@ -51,7 +51,7 @@
//if session created is not set then set the time
if (!isset($_SESSION['session']['created'])) {
$_SESSION['session']['created'] = time();
}
}
//check the elapsed time if exceeds limit then rotate the session
if (time() - $_SESSION['session']['created'] > 900) {
@@ -114,11 +114,8 @@
//if the session is not authorized then verify the identity
if (!$_SESSION['authorized']) {
//clear the menu
unset($_SESSION["menu"]);
//clear the template only if the template has not been assigned by the superadmin
if (empty($_SESSION['domain']['template']['name'])) {
if (empty($settings->get('domain', 'template'))) {
$_SESSION["template_content"] = '';
}
@@ -140,6 +137,13 @@
exit;
}
//clear the menu
unset($_SESSION["menu"]);
//get settings based on the user
$settings = new settings(['database' => $database, 'domain_uuid' => $_SESSION['domain_uuid'], 'user_uuid' => $_SESSION['user_uuid']]);
settings::clear_cache();
//if logged in, redirect to login destination
if (!isset($_REQUEST["key"])) {