From 38f838d84e400fece2b4e6bb0a2aea85a246ca1e Mon Sep 17 00:00:00 2001 From: Nathan Nguyen Date: Mon, 3 Dec 2018 14:36:54 +1100 Subject: [PATCH] Turn off check_wwwroot_accessible on admin pages other than outage setting page --- classes/local/outagelib.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php index d3a9702..0c23cfc 100644 --- a/classes/local/outagelib.php +++ b/classes/local/outagelib.php @@ -326,7 +326,7 @@ EOT; * @internal bootstrap_renderer $OUTPUT */ public static function generate_plugin_configuration_warning() { - global $CFG, $OUTPUT; + global $CFG, $OUTPUT, $PAGE; $message = []; @@ -338,8 +338,10 @@ EOT; $message[] = get_string('configurationdisabled', 'auth_outage'); } - if (!self::check_wwwroot_accessible()) { - $message[] = get_string('configurationinaccessiblewwwroot', 'auth_outage', ['wwwroot' => $CFG->wwwroot]); + if ($PAGE->pagetype == "admin-setting-auth_outage" || $PAGE->pagetype == "admin-setting-authsettingoutage") { + if (!self::check_wwwroot_accessible()) { + $message[] = get_string('configurationinaccessiblewwwroot', 'auth_outage', ['wwwroot' => $CFG->wwwroot]); + } } if (count($message) == 0) {