From f380a889e2d9fced09e560502cc089b1b50dad1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Sat, 3 Feb 2024 16:59:27 +0100 Subject: [PATCH] fix --- pages/home/account.php | 19 +++++++++---------- pages/home/settings.php | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/pages/home/account.php b/pages/home/account.php index 5728b15..109b131 100644 --- a/pages/home/account.php +++ b/pages/home/account.php @@ -3,17 +3,16 @@ require_once "lib/router.php"; require_once "lib/account.php"; -return [ - "output" => - function () { - global $routerConfig; +global $routerConfig; - if (isLoggedIn()) { - return file_get_contents($routerConfig["template_dir"] . "dashboard.html"); - } else { - return file_get_contents($routerConfig["template_dir"] . "login.html"); - } - }, +if (isLoggedIn()) { + $output = file_get_contents($routerConfig["template_dir"] . "dashboard.html"); +} else { + $output = file_get_contents($routerConfig["template_dir"] . "login.html"); +} + +return [ + "output" => $output, "parameters" => [ "minimal_permission_level" => 1, diff --git a/pages/home/settings.php b/pages/home/settings.php index 84fce73..4138bd9 100644 --- a/pages/home/settings.php +++ b/pages/home/settings.php @@ -3,17 +3,16 @@ require_once "lib/router.php"; require_once "lib/account.php"; -return [ - "output" => - function () { - global $routerConfig; +global $routerConfig; - if (isUserAdmin()) { - return file_get_contents($routerConfig["template_dir"] . "adminActions.html"); - } else { - return file_get_contents($routerConfig["template_dir"] . "userActions.html"); - } - }, +if (isUserAdmin()) { + $output = file_get_contents($routerConfig["template_dir"] . "adminActions.html"); +} else { + $output = file_get_contents($routerConfig["template_dir"] . "userActions.html"); +} + +return [ + "output" => $output, "parameters" => [ "minimal_permission_level" => 2,