diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php
index 7d5b340..42be2f5 100644
--- a/classes/local/outagelib.php
+++ b/classes/local/outagelib.php
@@ -246,6 +246,7 @@ class outagelib {
unset_config('maintenance_message');
}
set_config('maintenance_later', $outage->starttime);
+ self::maintenance_config_log($outage);
}
}
@@ -414,4 +415,21 @@ EOT;
return $message;
}
+
+ /**
+ * Logging for maintenance mode configuration.
+ *
+ * @param outage|null $outage Outage or null if no scheduled outage.
+ */
+ private static function maintenance_config_log(outage $outage) {
+ // Not output logging info in php unit test.
+ if (PHPUNIT_TEST) return;
+
+ mtrace(get_string('logformaintmodeconfig', 'auth_outage'));
+ $timezone = ' (Timezone ' . \core_date::get_server_timezone_object()->getName() . ')';
+ mtrace('... updated at ' . date('H:i:s'));
+ $time = date("Y-m-d H:i:s", $outage->starttime);
+ mtrace("... enable maintenance mode at $time $timezone");
+ mtrace(get_string('logformaintmodeconfigcomplete', 'auth_outage'));
+ }
}
diff --git a/lang/en/auth_outage.php b/lang/en/auth_outage.php
index 0324a19..80ca4a3 100644
--- a/lang/en/auth_outage.php
+++ b/lang/en/auth_outage.php
@@ -107,6 +107,8 @@ $string['allowedipsempty'] = 'When the allowed IPs list is empty we will not blo
$string['allowedipshasmyip'] = 'Your IP ({$a->ip}) is in the list and you will not be blocked out during an Outage.';
$string['allowedipshasntmyip'] = 'Your IP ({$a->ip}) is not in the list and you will be blocked out during an outage.';
$string['allowedipsnoconfig'] = 'Your config.php does not have the extra setup to allow blocking via IP.
Please refer to our README.md file for more information.';
+$string['logformaintmodeconfig'] = 'Update maintenance mode configuration.';
+$string['logformaintmodeconfigcomplete'] = 'Updating maintenance mode configuration complete.';
$string['menusettings'] = 'Settings';
$string['menumanage'] = 'Manage outages';
$string['messageoutagebackonline'] = 'We are back online!';
diff --git a/version.php b/version.php
index 3482760..dd71866 100644
--- a/version.php
+++ b/version.php
@@ -28,8 +28,8 @@
defined('MOODLE_INTERNAL') || die();
$plugin->component = "auth_outage";
-$plugin->version = 2022051200; // The current plugin version (Date: YYYYMMDDXX).
-$plugin->release = 2022051200; // Human-readable release information.
+$plugin->version = 2022121900; // The current plugin version (Date: YYYYMMDDXX).
+$plugin->release = 2022121900; // Human-readable release information.
$plugin->requires = 2017111309; // 2017111309 = T13, but this really requires 3.9 and higher.
$plugin->maturity = MATURITY_STABLE; // Suitable for PRODUCTION environments!
$plugin->supported = [39, 311]; // A range of branch numbers of supported moodle versions.