mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
Auth: Only reload CSS upon login if the theme **really** changed
fixes #2233
This commit is contained in:
parent
0aa4e25723
commit
f4da973f68
@ -17,6 +17,7 @@ use Icinga\User;
|
|||||||
use Icinga\User\Preferences;
|
use Icinga\User\Preferences;
|
||||||
use Icinga\User\Preferences\PreferencesStore;
|
use Icinga\User\Preferences\PreferencesStore;
|
||||||
use Icinga\Web\Session;
|
use Icinga\Web\Session;
|
||||||
|
use Icinga\Web\StyleSheet;
|
||||||
|
|
||||||
class Auth
|
class Auth
|
||||||
{
|
{
|
||||||
@ -100,8 +101,15 @@ class Auth
|
|||||||
{
|
{
|
||||||
$this->setupUser($user);
|
$this->setupUser($user);
|
||||||
|
|
||||||
// TODO(el): Quick-fix for #10957. Only reload CSS if the theme changed.
|
// Reload CSS if the theme changed
|
||||||
$this->getResponse()->setReloadCss(true);
|
$themingConfig = Icinga::app()->getConfig()->getSection('themes');
|
||||||
|
$userTheme = $user->getPreferences()->getValue('icingaweb', 'theme');
|
||||||
|
if (! (bool) $themingConfig->get('disabled', false) && $userTheme !== null) {
|
||||||
|
$defaultTheme = $themingConfig->get('default', StyleSheet::DEFAULT_THEME);
|
||||||
|
if ($userTheme !== $defaultTheme) {
|
||||||
|
$this->getResponse()->setReloadCss(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$this->user = $user;
|
$this->user = $user;
|
||||||
if ($persist) {
|
if ($persist) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user