From d6207a49ef95aa2c8ca95033a384d39498ca528a Mon Sep 17 00:00:00 2001 From: amit177 <8685831+amit177@users.noreply.github.com> Date: Sat, 2 Sep 2023 14:57:53 +0000 Subject: [PATCH 1/7] Change form post path --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index e62956f..be9b18e 100644 --- a/index.php +++ b/index.php @@ -182,7 +182,7 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran

Looking Glass

-
+
@@ -286,7 +286,7 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran outputCard.style.display = 'inherit' - fetch('/backend.php') + fetch('backend.php') .then(async (response) => { // response.body is a ReadableStream const reader = response.body.getReader() From 5850803887df377c7dc12048da55b39d27131bcb Mon Sep 17 00:00:00 2001 From: amit177 <8685831+amit177@users.noreply.github.com> Date: Sat, 2 Sep 2023 14:58:09 +0000 Subject: [PATCH 2/7] Refresh the page instead of redirecting --- bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index fb0ce09..92a2191 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -31,7 +31,7 @@ function exitErrorMessage(string $message): void function exitNormal(): void { - header('Location: /'); + header("Refresh: 0"); exit; } From 81f1bb7a20f92a5eeeb200440efc9272e929bae5 Mon Sep 17 00:00:00 2001 From: Karson Nichols <38633639+nicholsk18@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:00:16 -0500 Subject: [PATCH 3/7] added a way to add custom header and footer (#1) * added a way to add custom header and footer * rework to be backwords compatible for people who dont update their config file * isset to make sure no warnings are shown --- config.dist.php | 5 +++++ index.php | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/config.dist.php b/config.dist.php index 0215e72..fe18c9f 100644 --- a/config.dist.php +++ b/config.dist.php @@ -29,6 +29,11 @@ const LG_CUSTOM_HTML = __DIR__.'/custom.html.php'; // Define a file here which will be loaded on top of the index file, this can be used to do some post logic; const LG_CUSTOM_PHP = __DIR__.'/custom.post.php'; +// Define a file here which will be used to display the custom header. Will be at the top of file; +const LG_CUSTOM_HEADER_PHP = __DIR__.'/custom.header.php'; +// Define a file here which will be used to display the custom footer. Will be at the bottom of file; +const LG_CUSTOM_FOOTER_PHP = __DIR__.'/custom.footer.php'; + // Define the location of this network, usually a city and a country; const LG_LOCATION = 'Amsterdam, Netherlands'; // Define a query location for the link to openstreetmap (eg: Amsterdam, Netherlands will be https://www.openstreetmap.org/search?query=Amsterdam, Netherlands) diff --git a/index.php b/index.php index be9b18e..8fd0ade 100644 --- a/index.php +++ b/index.php @@ -75,6 +75,18 @@ if (LG_BLOCK_CUSTOM) { ob_start(); include LG_CUSTOM_HTML; $templateData['custom_html'] = ob_get_clean(); + + if (defined('LG_CUSTOM_HEADER_PHP')) { + ob_start(); + include LG_CUSTOM_HEADER_PHP; + $templateData['custom_header'] = ob_get_clean(); + } + + if (defined('LG_CUSTOM_FOOTER_PHP')) { + ob_start(); + include LG_CUSTOM_FOOTER_PHP; + $templateData['custom_footer'] = ob_get_clean(); + } } if (LG_CHECK_LATENCY && filter_var(LookingGlass::detectIpAddress(), FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) { @@ -97,6 +109,8 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran + +
@@ -274,6 +288,8 @@ $templateData['csrfToken'] = $_SESSION[LookingGlass::SESSION_CSRF] = bin2hex(ran
+ +