This commit is contained in:
Bruno Rybársky 2024-02-03 16:33:00 +01:00
parent 530c7ca13c
commit 6fdd76de3d
2 changed files with 34 additions and 35 deletions

@ -3,22 +3,21 @@
require_once "lib/router.php";
require_once "lib/account.php";
$page_parameters = ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Account"];
function render(): string
{
return [
"output" =>
function () {
global $routerConfig;
ob_start();
if (isLoggedIn()) {
echo file_get_contents($routerConfig["template_dir"] . "dashboard.html");
return file_get_contents($routerConfig["template_dir"] . "dashboard.html");
} else {
echo file_get_contents($routerConfig["template_dir"] . "login.html");
return file_get_contents($routerConfig["template_dir"] . "login.html");
}
return ob_get_clean();
}
return ["output" => render(), "parameters" => $page_parameters];
},
"parameters" =>
[
"minimal_permission_level" => 1,
"secret" => "no",
"page_title" => "Account"
]
];

@ -3,21 +3,21 @@
require_once "lib/router.php";
require_once "lib/account.php";
$page_parameters = ["minimal_permission_level" => 2, "secret" => "no", "page_title" => "Settings"];
function render(): string
{
return [
"output" =>
function () {
global $routerConfig;
ob_start();
if (isUserAdmin()) {
echo file_get_contents($routerConfig["template_dir"] . "adminActions.html");
return file_get_contents($routerConfig["template_dir"] . "adminActions.html");
} else {
echo file_get_contents($routerConfig["template_dir"] . "userActions.html");
return file_get_contents($routerConfig["template_dir"] . "userActions.html");
}
return ob_get_clean();
}
return ["output" => render(), "parameters" => $page_parameters];
},
"parameters" =>
[
"minimal_permission_level" => 2,
"secret" => "no",
"page_title" => "Account"
]
];