getContext()->getUser(); $template = $user ? "admin.twig" : "redirect.twig"; $params = $user ? [] : ["url" => "/login"]; $this->title = "Administration"; $this->searchable = false; parent::__construct($router, $template, $params); $this->enableCSP(); $this->addCSPWhitelist("/js/admin-panel/"); } }