Browse Source

fix(theming): enforce theme also for login

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/51754/head
Ferdinand Thiessen 7 months ago
committed by backportbot[bot]
parent
commit
69274eba66
  1. 4
      core/templates/layout.guest.php
  2. 2
      lib/private/TemplateLayout.php

4
core/templates/layout.guest.php

@ -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">

2
lib/private/TemplateLayout.php

@ -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) {

Loading…
Cancel
Save