From 8d8870a72abcb7109f9a105fe61bfcac2a838f69 Mon Sep 17 00:00:00 2001 From: Mehmet S Date: Mon, 19 Aug 2024 06:57:20 +0000 Subject: [PATCH] add maintenance mode --- private/pages/login.php | 5 +++++ private/pages/oidc_login.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/private/pages/login.php b/private/pages/login.php index 3b20835..dfbbc46 100644 --- a/private/pages/login.php +++ b/private/pages/login.php @@ -109,6 +109,11 @@ '; } + if ((isset($env) ? strtolower($env["Authentication"]) : strtolower(getenv("Authentication"))) == "you_shall_not_pass") { + $login_available = true; + echo + 'HM-KI ist im Wartungsmodus.'; + } if (!$login_available) { echo 'No authentication method defined'; die; diff --git a/private/pages/oidc_login.php b/private/pages/oidc_login.php index 3ec76cc..b28ba45 100644 --- a/private/pages/oidc_login.php +++ b/private/pages/oidc_login.php @@ -35,6 +35,11 @@ $_SESSION['username'] = $oidc->requestUserInfo('email'); +//TODO: check for affiliation +if ((isset($env) ? strtolower($env["Authentication"]) : strtolower(getenv("Authentication"))) == "you_shall_not_pass") { + header("Location: /login") +} + header("Location: /interface"); exit();