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