From a45b5073cac989da084f1bdb44cac71b6c6a61a8 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Thu, 11 Jun 2015 14:26:47 +0200 Subject: Implement a maintenance mode Add support for a maintenance mode that disables both the website and the SSH interface and can be enabled easily using a configuration option. Signed-off-by: Lukas Fleischer --- web/html/index.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'web/html/index.php') diff --git a/web/html/index.php b/web/html/index.php index 0275d0a..27f81c8 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -7,6 +7,12 @@ include_once("pkgfuncs.inc.php"); $path = $_SERVER['PATH_INFO']; $tokens = explode('/', $path); +if (config_get_bool('options', 'enable-maintenance') && (empty($tokens[1]) || ($tokens[1] != "css" && $tokens[1] != "images"))) { + header("HTTP/1.0 503 Service Unavailable"); + include "./503.php"; + return; +} + if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { if (!empty($tokens[2])) { /* TODO: Create a proper data structure to pass variables from -- cgit v1.2.3-70-g09d2