diff options
author | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-11 14:41:06 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@archlinux.org> | 2015-06-11 14:48:01 +0200 |
commit | 078f7256e3424c3fad304a3c90f735c88060d277 (patch) | |
tree | 56a7499eb38c01a070ec4ce5e7ea104f44a2515e /web | |
parent | a45b5073cac989da084f1bdb44cac71b6c6a61a8 (diff) | |
download | aurweb-078f7256e3424c3fad304a3c90f735c88060d277.tar.xz |
Support exceptions in the maintenance mode
Allow for excluding certain IP addresses from the maintenance mode. This
allows administrators to view the web page while the site is still under
maintenance for the rest of the world.
Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web')
-rw-r--r-- | web/html/index.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/web/html/index.php b/web/html/index.php index 27f81c8..27d897c 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -8,9 +8,11 @@ $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 (!in_array($_SERVER['REMOTE_ADDR'], explode(" ", config_get('options', 'maintenance-exceptions')))) { + header("HTTP/1.0 503 Service Unavailable"); + include "./503.php"; + return; + } } if (!empty($tokens[1]) && '/' . $tokens[1] == get_pkg_route()) { |