Issue #390: Changed outage auto-start default parameter from checkbox to dropdown with option to fully disable.

This commit is contained in:
abhinavgandham
2026-01-14 12:00:01 +10:00
committed by Brendan Heywood
parent ceee32d889
commit 551a97142c
3 changed files with 12 additions and 2 deletions

View File

@@ -32,6 +32,8 @@ $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['autostartoff'] = 'Default off';
$string['autostarton'] = 'Default on';
$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";
@@ -99,6 +101,7 @@ $string['defaultwarningdurationdescription'] = 'Default warning time (in minutes
$string['description'] = 'Public Description';
$string['description_help'] = 'A full description of the outage, publicly visible by all users.';
$string['finish'] = 'Finish';
$string['forceoff'] = 'Force off';
$string['info15secondsbefore'] = '15 seconds before';
$string['infoendofoutage'] = 'end of outage';
$string['infofrom'] = 'From:';

View File

@@ -43,11 +43,16 @@ if ($hassiteconfig) {
get_string('settingssectiondefaultsdescription', 'auth_outage') . $description
));
$settings->add(new admin_setting_configcheckbox(
$settings->add(new admin_setting_configselect(
'auth_outage/default_autostart',
get_string('defaultoutageautostart', 'auth_outage'),
get_string('defaultoutageautostartdescription', 'auth_outage'),
$defaults['default_autostart']
'off',
[
'0' => get_string('autostartoff', 'auth_outage'),
'1' => get_string('autostarton', 'auth_outage'),
'2' => get_string('forceoff', 'auth_outage'),
]
));
$settings->add(new admin_setting_configduration(

View File

@@ -30,6 +30,8 @@ defined('MOODLE_INTERNAL') || die();
$plugin->component = "auth_outage";
$plugin->version = 2024081900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2024081900; // Human-readable release information.
$plugin->version = 2024081900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->release = 2024081900; // 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, 405]; // A range of branch numbers of supported moodle versions.