From c0fbaec15a7977efef930ee1a42774a27053e7eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Fri, 2 Feb 2024 15:50:39 +0100 Subject: [PATCH] test apex domain --- lib/endpoint.php | 2 +- lib/navigation.php | 2 +- lib/router.php | 2 -- pages/{apex => home}/account.php | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) rename pages/{apex => home}/account.php (95%) diff --git a/lib/endpoint.php b/lib/endpoint.php index 201c2c7..0f80bc3 100644 --- a/lib/endpoint.php +++ b/lib/endpoint.php @@ -23,7 +23,7 @@ function getEndpoint($endpoint_name): string $endpoint_file = $routerConfig["endpoint_dir"] . $routerRequest["subdomain"] . "/" . $endpoint_name . ".php"; - $endpoint_file_global = $routerConfig["endpoint_dir"] . "apex/" . $endpoint_name . ".php"; + $endpoint_file_global = $routerConfig["endpoint_dir"] . "home/" . $endpoint_name . ".php"; if (file_exists($endpoint_file_global)){ $output = runEndpoint($endpoint_file_global); diff --git a/lib/navigation.php b/lib/navigation.php index cafc1bc..8058d7c 100644 --- a/lib/navigation.php +++ b/lib/navigation.php @@ -20,7 +20,7 @@ function generateNavigation(): string $site_name = str_replace("_", " ", $site_dir); $site_subdomain = $site_dir . "."; - if ($site_name == "apex") { + if ($site_name == $routerConfig["default_site"]) { $site_subdomain = ""; } diff --git a/lib/router.php b/lib/router.php index ef49219..87cab8d 100644 --- a/lib/router.php +++ b/lib/router.php @@ -12,8 +12,6 @@ function initRouter(): bool if(count($routerRequest["requestAddress"]) < 3){ // Root domain accessed directly - $needsRedirect = true; - $routerRequest["subdomain"] = $routerConfig["default_site"]; $routerRequest["domain"] = basename($routerRequest["requestAddress"][0]); $routerRequest["tld"] = basename($routerRequest["requestAddress"][1]); diff --git a/pages/apex/account.php b/pages/home/account.php similarity index 95% rename from pages/apex/account.php rename to pages/home/account.php index dd6fc3b..7b0a87c 100644 --- a/pages/apex/account.php +++ b/pages/home/account.php @@ -14,7 +14,7 @@ function render(): string ob_start(); if ($_SESSION["ID"] > 0) { - $account_template = file_get_contents($routerConfig["template_dir"] . "apex.html"); + $account_template = file_get_contents($routerConfig["template_dir"] . "home.html"); echo $account_template; } else { $login_template = file_get_contents($routerConfig["template_dir"] . "login.html");