forked from Adleraci/adlerka.top
test
This commit is contained in:
parent
530c7ca13c
commit
6fdd76de3d
@ -3,22 +3,21 @@
|
|||||||
require_once "lib/router.php";
|
require_once "lib/router.php";
|
||||||
require_once "lib/account.php";
|
require_once "lib/account.php";
|
||||||
|
|
||||||
$page_parameters = ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Account"];
|
return [
|
||||||
|
"output" =>
|
||||||
|
function () {
|
||||||
|
global $routerConfig;
|
||||||
|
|
||||||
|
if (isLoggedIn()) {
|
||||||
function render(): string
|
return file_get_contents($routerConfig["template_dir"] . "dashboard.html");
|
||||||
{
|
} else {
|
||||||
global $routerConfig;
|
return file_get_contents($routerConfig["template_dir"] . "login.html");
|
||||||
|
}
|
||||||
ob_start();
|
},
|
||||||
|
"parameters" =>
|
||||||
if (isLoggedIn()) {
|
[
|
||||||
echo file_get_contents($routerConfig["template_dir"] . "dashboard.html");
|
"minimal_permission_level" => 1,
|
||||||
} else {
|
"secret" => "no",
|
||||||
echo file_get_contents($routerConfig["template_dir"] . "login.html");
|
"page_title" => "Account"
|
||||||
}
|
]
|
||||||
|
];
|
||||||
return ob_get_clean();
|
|
||||||
}
|
|
||||||
|
|
||||||
return ["output" => render(), "parameters" => $page_parameters];
|
|
@ -3,21 +3,21 @@
|
|||||||
require_once "lib/router.php";
|
require_once "lib/router.php";
|
||||||
require_once "lib/account.php";
|
require_once "lib/account.php";
|
||||||
|
|
||||||
$page_parameters = ["minimal_permission_level" => 2, "secret" => "no", "page_title" => "Settings"];
|
return [
|
||||||
|
"output" =>
|
||||||
|
function () {
|
||||||
|
global $routerConfig;
|
||||||
|
|
||||||
function render(): string
|
if (isUserAdmin()) {
|
||||||
{
|
return file_get_contents($routerConfig["template_dir"] . "adminActions.html");
|
||||||
global $routerConfig;
|
} else {
|
||||||
|
return file_get_contents($routerConfig["template_dir"] . "userActions.html");
|
||||||
ob_start();
|
}
|
||||||
|
},
|
||||||
if (isUserAdmin()) {
|
"parameters" =>
|
||||||
echo file_get_contents($routerConfig["template_dir"] . "adminActions.html");
|
[
|
||||||
} else {
|
"minimal_permission_level" => 2,
|
||||||
echo file_get_contents($routerConfig["template_dir"] . "userActions.html");
|
"secret" => "no",
|
||||||
}
|
"page_title" => "Account"
|
||||||
|
]
|
||||||
return ob_get_clean();
|
];
|
||||||
}
|
|
||||||
|
|
||||||
return ["output" => render(), "parameters" => $page_parameters];
|
|
||||||
|
Loading…
Reference in New Issue
Block a user