login: Fix that the system's default theme is not applied

fixes #11021
This commit is contained in:
Johannes Meyer 2016-01-22 16:34:31 +01:00
parent 5e51bb9c74
commit 8a17cc5161
1 changed files with 4 additions and 7 deletions

View File

@ -115,19 +115,16 @@ class StyleSheet
$themingConfig = $this->app->getConfig()->getSection('themes');
$defaultTheme = $themingConfig->get('default');
$theme = null;
if ($defaultTheme !== null && $defaultTheme !== self::DEFAULT_THEME) {
$theme = $defaultTheme;
}
if ((bool) $themingConfig->get('disabled', false)) {
if ($defaultTheme !== null && $defaultTheme !== self::DEFAULT_THEME) {
$theme = $defaultTheme;
}
} else {
if (! (bool) $themingConfig->get('disabled', false)) {
$auth = Auth::getInstance();
if ($auth->isAuthenticated()) {
$userTheme = $auth->getUser()->getPreferences()->getValue('icingaweb', 'theme');
if ($userTheme !== null) {
$theme = $userTheme;
} elseif ($defaultTheme !== null && $defaultTheme !== self::DEFAULT_THEME) {
$theme = $defaultTheme;
}
}
}