diff --git a/classes/local/outagelib.php b/classes/local/outagelib.php
index 93722c2..b23f99c 100644
--- a/classes/local/outagelib.php
+++ b/classes/local/outagelib.php
@@ -279,6 +279,7 @@ class outagelib {
* @param int $stoptime Outage stop time.
* @param string $allowedips List of IPs allowed.
* @param string|null $accesskey access key, or null if no access key set.
+ * @param string|null $metadata Metadata to set in headers, or null if none.
*
* @return string
* @throws invalid_parameter_exception
@@ -370,8 +371,17 @@ EOT;
$search = ['{{STARTTIME}}', '{{STOPTIME}}', '{{USEALLOWEDIPS}}', '{{ALLOWEDIPS}}', '{{USEACCESSKEY}}', '{{ACCESSKEY}}',
'{{YOURIP}}', '{{COOKIESECURE}}', '{{COOKIEHTTPONLY}}', '{{METADATA}}'];
// Note that var_export is required because (string) false == '', not 'false'.
- $replace = [$starttime, $stoptime, var_export(!empty($allowedips), true), $allowedips, var_export(!empty($accesskey), true),
- $accesskey, getremoteaddr('n/a'), var_export($cookiesecure, true), var_export($cookiehttponly, true), var_export($metadata, true)];
+ $replace = [
+ $starttime,
+ $stoptime,
+ var_export(!empty($allowedips), true),
+ $allowedips,
+ var_export(!empty($accesskey), true),
+ $accesskey,
+ getremoteaddr('n/a'),
+ var_export($cookiesecure, true),
+ var_export($cookiehttponly, true),
+ var_export($metadata, true)];
return str_replace($search, $replace, $code);
}
diff --git a/db/upgrade.php b/db/upgrade.php
index 8d27d7a..8d28ef6 100644
--- a/db/upgrade.php
+++ b/db/upgrade.php
@@ -62,7 +62,6 @@ function xmldb_auth_outage_upgrade($oldversion) {
}
if ($oldversion < 2026011301) {
-
// Define field metadata to be added to auth_outage.
$table = new xmldb_table('auth_outage');
$field = new xmldb_field('metadata', XMLDB_TYPE_TEXT, null, null, null, null, null, 'accesskey');
diff --git a/lang/en/auth_outage.php b/lang/en/auth_outage.php
index 5d72a9f..6972aab 100644
--- a/lang/en/auth_outage.php
+++ b/lang/en/auth_outage.php
@@ -32,9 +32,9 @@ $string['allowedipsnoconfig'] = 'Your config.php does not have the extra setup t
$string['auth_outagedescription'] = 'Auxiliary plugin that warns users about a future outage and prevents them from logging in once the outage starts.';
$string['autostart'] = 'Auto start maintenance mode.';
$string['autostart_help'] = 'If selected, when the outage starts it will automatically turn on Moodle maintenance mode.';
+$string['autostartforcedoff'] = 'Force off';
$string['autostartoff'] = 'Default off';
$string['autostarton'] = 'Default on';
-$string['autostartforcedoff'] = 'Force off';
$string['builtinallowediplist'] = 'Builtin Allowed IP List';
$string['builtinallowediplist_desc'] = 'A second allowed IP list which makes it easier to have some IPs forced in config.php and others editable in the UI';
$string['clicreateexamples'] = "Create an outage starting in 10 seconds\n\n> php create.php -s=10";
@@ -144,6 +144,7 @@ $string['outagefinishwarning'] = 'You are about to mark this outage as finished.
$string['outageslistfuture'] = 'Planned outages';
$string['outageslistpast'] = 'Outage history';
$string['pluginname'] = 'Outage manager';
+$string["privacy:no_data_reason"] = "The Outage authentication plugin does not store any personal data.";
$string['removeselectors'] = 'Remove selectors';
$string['removeselectorsdescription'] = 'CSS selectors to remove when rendering a static themed maintenance page. One selector per line.';
$string['settingssectiondefaults'] = 'Default Outage Parameters';
@@ -173,8 +174,3 @@ $string['warningduration'] = 'Warning duration';
$string['warningduration_help'] = 'How long before the start of the outage should the warning be displayed.';
$string['warningdurationerrorinvalid'] = 'Warning duration must be positive.';
$string['warningreenablemaintenancemode'] = 'Please note that saving this outage will re-enable maintenance mode.
Untick "Auto start maintenance mode" if you want to prevent this.';
-
-/*
- * Privacy provider (GDPR)
- */
-$string["privacy:no_data_reason"] = "The Outage authentication plugin does not store any personal data.";
diff --git a/tests/local/cli/waitforit_test.php b/tests/local/cli/waitforit_test.php
index 350b79a..03c9d5f 100644
--- a/tests/local/cli/waitforit_test.php
+++ b/tests/local/cli/waitforit_test.php
@@ -160,7 +160,7 @@ final class waitforit_test extends cli_testcase {
/**
* Tests the countdown.
*/
- public function test_countdown() {
+ public function test_countdown(): void {
self::setAdminUser();
$now = time();
outagedb::save(new outage([
@@ -189,7 +189,7 @@ final class waitforit_test extends cli_testcase {
/**
* Tests if the outage changed while waiting.
*/
- public function test_outagechanged() {
+ public function test_outagechanged(): void {
self::setAdminUser();
$now = time();
$id = outagedb::save(new outage([
diff --git a/tests/local/controllers/maintenance_static_page_test.php b/tests/local/controllers/maintenance_static_page_test.php
index 3155db3..2aa6092 100644
--- a/tests/local/controllers/maintenance_static_page_test.php
+++ b/tests/local/controllers/maintenance_static_page_test.php
@@ -583,7 +583,7 @@ final class maintenance_static_page_test extends \auth_outage\base_testcase {
/**
* Test meta refresh maximum 5 minutes.
*/
- public function test_meta_refresh_maximum_5seconds() {
+ public function test_meta_refresh_maximum_5seconds(): void {
$this->resetAfterTest(true);
$html = "\n" .
'