mirror of
https://github.com/nextcloud/server.git
synced 2026-02-18 18:28:50 -05:00
fix(Template): harden enabled-theme logic
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
56b9974c41
commit
8503ce8968
1 changed files with 1 additions and 8 deletions
|
|
@ -144,12 +144,6 @@ class TemplateLayout {
|
|||
$userDisplayName = $user->getDisplayName();
|
||||
}
|
||||
|
||||
$page->assign('enabledThemes', []);
|
||||
if ($this->appManager->isEnabledForUser('theming') && class_exists('\OCA\Theming\Service\ThemesService')) {
|
||||
$themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
|
||||
$page->assign('enabledThemes', $themesService->getEnabledThemes());
|
||||
}
|
||||
|
||||
$page->assign('user_displayname', $userDisplayName);
|
||||
$page->assign('user_uid', \OC_User::getUser());
|
||||
break;
|
||||
|
|
@ -200,10 +194,9 @@ class TemplateLayout {
|
|||
// Set body data-theme
|
||||
try {
|
||||
$themesService = Server::get(\OCA\Theming\Service\ThemesService::class);
|
||||
} catch (\OCP\AppFramework\QueryException) {
|
||||
} catch (\Exception) {
|
||||
$themesService = null;
|
||||
}
|
||||
|
||||
$page->assign('enabledThemes', $themesService?->getEnabledThemes() ?? []);
|
||||
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue