2024-01-11 09:27:03 +01:00
|
|
|
<?php
|
2024-01-16 20:43:57 +01:00
|
|
|
/** @noinspection PhpIncludeInspection */
|
|
|
|
require_once "secrets/config.php";
|
2024-01-16 20:54:09 +01:00
|
|
|
require_once "lib/config.php";
|
2024-01-18 11:49:38 +01:00
|
|
|
require_once "lib/navigation.php";
|
|
|
|
require_once "lib/router.php";
|
|
|
|
require_once "lib/page.php";
|
|
|
|
require_once "lib/endpoint.php";
|
2024-02-01 09:38:16 +01:00
|
|
|
require_once "lib/account.php";
|
2024-01-11 09:27:03 +01:00
|
|
|
|
2024-01-16 20:43:57 +01:00
|
|
|
$routerConfig = array();
|
|
|
|
$routerRequest = array();
|
2024-01-11 09:27:03 +01:00
|
|
|
|
2024-01-16 20:43:57 +01:00
|
|
|
loadRouterConfig();
|
|
|
|
if(initRouter()) {
|
|
|
|
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
|
|
|
session_set_cookie_params(0, '/', "." . $routerRequest["domain"] . "." . $routerRequest["tld"], true, true);
|
|
|
|
session_start();
|
2024-02-01 09:38:16 +01:00
|
|
|
|
2024-02-01 09:55:25 +01:00
|
|
|
print_r(isLoggedIn());
|
2024-02-01 09:38:16 +01:00
|
|
|
if(!isLoggedIn()){
|
|
|
|
setDefaultSessionData();
|
|
|
|
}
|
|
|
|
|
2024-01-18 11:49:38 +01:00
|
|
|
if($routerRequest["type"] == "api") {
|
2024-01-31 23:07:12 +01:00
|
|
|
echo getEndpoint($routerRequest["page_name"]);
|
2024-01-18 11:49:38 +01:00
|
|
|
|
|
|
|
}elseif ($routerRequest["type"] == "page") {
|
|
|
|
/** @noinspection PhpArrayIsAlwaysEmptyInspection */
|
|
|
|
echo getPage($routerRequest["page_name"]);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
echo "Unknown request";
|
|
|
|
}
|
2024-01-16 20:43:57 +01:00
|
|
|
}
|
|
|
|
else{
|
|
|
|
exit();
|
|
|
|
}
|
2024-01-11 09:27:03 +01:00
|
|
|
|