From c53a629bc84462cb6e6605e7cdf40c57fd7b2c4d Mon Sep 17 00:00:00 2001 From: John Yao Date: Thu, 11 Feb 2021 16:41:29 +1100 Subject: [PATCH] Fix #233 Add no_outage check to allow checkfinished.php to be execpt from the 503 maintenance logic --- bootstrap.php | 3 ++- checkfinished.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bootstrap.php b/bootstrap.php index b06e11a..831dff3 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -79,7 +79,8 @@ if (!empty($_SERVER['REQUEST_URI'])) { $allowed = !file_exists($CFG->dataroot.'/climaintenance.php') // Not in maintenance mode. || (defined('ABORT_AFTER_CONFIG') && ABORT_AFTER_CONFIG) // Only config requested. || (defined('CLI_SCRIPT') && CLI_SCRIPT) // Allow CLI scripts. - || $outageinfo; // Allow outage info requests. + || $outageinfo // Allow outage info requests. + || (defined('NO_AUTH_OUTAGE') && NO_AUTH_OUTAGE); // Allow any page should not be blocked by maintenance mode. if (!$allowed) { // Call the climaintenance.php which will check for allowed IPs. $CFG->dirroot = dirname(dirname(dirname(__FILE__))); // It is not defined yet but the script below needs it. diff --git a/checkfinished.php b/checkfinished.php index ad8e69d..e090ad5 100644 --- a/checkfinished.php +++ b/checkfinished.php @@ -27,6 +27,7 @@ use auth_outage\dml\outagedb; define('NO_MOODLE_COOKIES', true); header('Cache-Control: public, max-age=10,s-maxage=10'); +define('NO_AUTH_OUTAGE', true); require_once(__DIR__.'/../../config.php');