Merge pull request #51753 from nextcloud/backport/50121/stable31

[stable31] fix(theming): enforce theme also for login
This commit is contained in:
John Molakvoæ 2025-03-28 09:36:24 +01:00 committed by GitHub
commit fa2b03d759
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -35,7 +35,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 include 'layout.initial-state.php'; ?>
<div class="wrapper">

View file

@ -151,6 +151,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) {