PreferenceForm: Detect client changes based on current session

not based on the stored preferences. The session is more up2date.

refs #4417
This commit is contained in:
Johannes Meyer 2021-07-05 18:08:15 +02:00
parent ed6d5f4958
commit df49f0c241
1 changed files with 5 additions and 4 deletions

View File

@ -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 === ''