web-base/core/Documents/Admin.class.php
2021-12-08 16:54:53 +01:00

15 lines
375 B
PHP

<?php
namespace Documents;
use Elements\TemplateDocument;
use Objects\User;
class Admin extends TemplateDocument {
public function __construct(User $user) {
$template = $user->isLoggedIn() ? "admin.twig" : "redirect.twig";
$params = $user->isLoggedIn() ? [] : ["url" => "/login"];
parent::__construct($user, $template, $params);
$this->enableCSP();
}
}