mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
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 <lfleischer@archlinux.org>
This commit is contained in:
parent
2164750f1e
commit
a45b5073ca
4 changed files with 27 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue