From df49f0c2418e82d5115bd2ef6a889f1502eb7496 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 5 Jul 2021 18:08:15 +0200 Subject: [PATCH] PreferenceForm: Detect client changes based on current session not based on the stored preferences. The session is more up2date. refs #4417 --- application/forms/PreferenceForm.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/application/forms/PreferenceForm.php b/application/forms/PreferenceForm.php index 96d004cdf..7fd9b02d0 100644 --- a/application/forms/PreferenceForm.php +++ b/application/forms/PreferenceForm.php @@ -93,12 +93,13 @@ class PreferenceForm extends Form */ public function onSuccess() { - $this->preferences = new Preferences($this->store ? $this->store->load() : array()); - $oldTheme = $this->preferences->getValue('icingaweb', 'theme'); - $oldMode = $this->preferences->getValue('icingaweb', 'theme_mode'); - $oldLocale = $this->preferences->getValue('icingaweb', 'language'); + $currentPreferences = $this->Auth()->getUser()->getPreferences(); + $oldTheme = $currentPreferences->getValue('icingaweb', 'theme'); + $oldMode = $currentPreferences->getValue('icingaweb', 'theme_mode'); + $oldLocale = $currentPreferences->getValue('icingaweb', 'language'); $defaultTheme = Config::app()->get('themes', 'default', StyleSheet::DEFAULT_THEME); + $this->preferences = new Preferences($this->store ? $this->store->load() : array()); $webPreferences = $this->preferences->get('icingaweb', array()); foreach ($this->getValues() as $key => $value) { if ($value === ''