Implement a bunch of stuff
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once "lib/router.php";
|
||||
require_once "lib/account.php";
|
||||
|
||||
function get_parameters():array
|
||||
{
|
||||
return ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Domov"];
|
||||
return ["minimal_permission_level" => 1, "secret" => "no", "page_title" => "Account"];
|
||||
}
|
||||
|
||||
function render(): string
|
||||
@@ -13,12 +14,10 @@ function render(): string
|
||||
|
||||
ob_start();
|
||||
|
||||
if ($_SESSION["ID"] > 0) {
|
||||
$account_template = file_get_contents($routerConfig["template_dir"] . "home.html");
|
||||
echo $account_template;
|
||||
if (isLoggedIn()) {
|
||||
echo file_get_contents($routerConfig["template_dir"] . "dashboard.html");
|
||||
} else {
|
||||
$login_template = file_get_contents($routerConfig["template_dir"] . "login.html");
|
||||
echo $login_template;
|
||||
echo file_get_contents($routerConfig["template_dir"] . "login.html");
|
||||
}
|
||||
|
||||
return ob_get_clean();
|
||||
|
24
pages/home/settings.php
Normal file
24
pages/home/settings.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
require_once "lib/router.php";
|
||||
require_once "lib/account.php";
|
||||
|
||||
function get_parameters():array
|
||||
{
|
||||
return ["minimal_permission_level" => 2, "secret" => "no", "page_title" => "Settings"];
|
||||
}
|
||||
|
||||
function render(): string
|
||||
{
|
||||
global $routerConfig;
|
||||
|
||||
ob_start();
|
||||
|
||||
if (isUserAdmin()) {
|
||||
echo file_get_contents($routerConfig["template_dir"] . "adminActions.html");
|
||||
} else {
|
||||
echo file_get_contents($routerConfig["template_dir"] . "userActions.html");
|
||||
}
|
||||
|
||||
return ob_get_clean();
|
||||
}
|
Reference in New Issue
Block a user