diff --git a/library/Icinga/Authentication/Auth.php b/library/Icinga/Authentication/Auth.php index fa5b52868..d56d3789b 100644 --- a/library/Icinga/Authentication/Auth.php +++ b/library/Icinga/Authentication/Auth.php @@ -104,14 +104,19 @@ class Auth // Reload CSS if the theme changed $themingConfig = Icinga::app()->getConfig()->getSection('themes'); $userTheme = $user->getPreferences()->getValue('icingaweb', 'theme'); - $themeMode = $user->getPreferences()->getValue('icingaweb', 'theme_mode'); if (! (bool) $themingConfig->get('disabled', false) && $userTheme !== null) { $defaultTheme = $themingConfig->get('default', StyleSheet::DEFAULT_THEME); - if (($userTheme !== $defaultTheme) || ($themeMode !== StyleSheet::DEFAULT_MODE)) { + if ($userTheme !== $defaultTheme) { $this->getResponse()->setReloadCss(true); } } + // Also reload CSS if the theme mode changed + $themeMode = $user->getPreferences()->getValue('icingaweb', 'theme_mode'); + if ($themeMode && $themeMode !== StyleSheet::DEFAULT_MODE) { + $this->getResponse()->setReloadCss(true); + } + // Reload entire layout if the locale changed if (($locale = $user->getPreferences()->getValue('icingaweb', 'language')) !== null) { if (setlocale(LC_ALL, 0) !== $locale && $this->getRequest()->isXmlHttpRequest()) {