diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-27 11:11:59 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2025-03-27 11:11:59 +0100 |
commit | d60d72d808881f40a356001ba819f8d4c35f2643 (patch) | |
tree | b923ce8a5e8682db06d24b633f14932ba770ef1d | |
parent | 6b0d3b67c18ea2022386d0ccf614d779bd70add7 (diff) | |
download | nextcloud-server-backport/50076/stable29.tar.gz nextcloud-server-backport/50076/stable29.zip |
fix(theming): enforce theme also for loginbackport/50076/stable29
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
-rw-r--r-- | core/templates/layout.guest.php | 4 | ||||
-rw-r--r-- | lib/private/TemplateLayout.php | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php index 5ebada92934..363fe9dde26 100644 --- a/core/templates/layout.guest.php +++ b/core/templates/layout.guest.php @@ -25,7 +25,9 @@ p($theme->getTitle()); <?php emit_script_loading_tags($_); ?> <?php print_unescaped($_['headers']); ?> </head> - <body id="<?php p($_['bodyid']);?>"> + <body id="<?php p($_['bodyid']);?>" <?php foreach ($_['enabledThemes'] as $themeId) { + p("data-theme-$themeId "); + }?> data-themes="<?php p(join(',', $_['enabledThemes'])) ?>"> <?php include 'layout.noscript.warning.php'; ?> <?php foreach ($_['initialStates'] as $app => $initialState) { ?> <input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>"> diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index f36af19e55c..5d29b06a73b 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -183,6 +183,8 @@ class TemplateLayout extends \OC_Template { if ($user) { $userDisplayName = $user->getDisplayName(); } + $theme = $this->config->getSystemValueString('enforce_theme', ''); + $this->assign('enabledThemes', $theme === '' ? [] : [$theme]); $this->assign('user_displayname', $userDisplayName); $this->assign('user_uid', \OC_User::getUser()); } elseif ($renderAs === TemplateResponse::RENDER_AS_PUBLIC) { |