diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/html/503.php | 15 | ||||
-rw-r--r-- | web/html/index.php | 6 |
2 files changed, 21 insertions, 0 deletions
diff --git a/web/html/503.php b/web/html/503.php new file mode 100644 index 00000000..80eb4369 --- /dev/null +++ b/web/html/503.php @@ -0,0 +1,15 @@ +<?php + +set_include_path(get_include_path() . PATH_SEPARATOR . '../lib'); + +html_header( __("Service Unavailable") ); +?> + +<div id="error-page" class="box 503"> + <h2>503 - <?= __("Service Unavailable") ?></h2> + <p><?= __("Don't panic! This site is down due to maintenance. We will be back soon.") ?></p> +</div> + +<?php +html_footer(AURWEB_VERSION); + diff --git a/web/html/index.php b/web/html/index.php index 0275d0af..27f81c84 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 |