mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 05:44:36 +02:00
StyleSheet: Only set theme on the compiler if it exists
The compiler itself can handle invalid themes, but doesn't log the user name which makes it hard to track the cause down.
This commit is contained in:
parent
c5343f5575
commit
1e6639971f
@ -160,7 +160,16 @@ class StyleSheet
|
||||
}
|
||||
|
||||
if ($themePath = self::getThemeFile($theme)) {
|
||||
if ($this->app->isCli() || is_file($themePath) && is_readable($themePath)) {
|
||||
$this->lessCompiler->setTheme($themePath);
|
||||
} else {
|
||||
$themePath = null;
|
||||
Logger::warning(sprintf(
|
||||
'Theme "%s" set by user "%s" has not been found.',
|
||||
$theme,
|
||||
($user = Auth::getInstance()->getUser()) !== null ? $user->getUsername() : 'anonymous'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
if (! $themePath || in_array($theme, self::THEME_WHITELIST, true)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user