From cb9d1193c37b7567dcad5497330169d43ab1e8a2 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Mon, 27 May 2024 00:29:36 -0400 Subject: initial --- src/web/index.php | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 src/web/index.php (limited to 'src/web/index.php') diff --git a/src/web/index.php b/src/web/index.php new file mode 100644 index 0000000..ffd6b06 --- /dev/null +++ b/src/web/index.php @@ -0,0 +1,66 @@ + $title, + 'msg' => $msg + )); +} else { + if (($user = key_auth())) { + http_response_code(200); + header("X-Webauth-User: $user"); + die(); + } + + $host = $_SERVER['HTTP_HOST']; + $env = getenv("HTTP_HOST"); + if ($host != $env) { + // we are being forwarded authed + // redirect + http_response_code(301); + header("Location: https://$env"); + } else { + page('login', array( + 'title' => 'Login' + )); + } +} -- cgit v1.2.3-freya