Issue #390: Reverted new 'Force off' option and dropdown conversion.

This commit is contained in:
abhinavgandham
2026-01-20 15:06:49 +10:00
committed by Brendan Heywood
parent 83cb36660b
commit 6ca7cb6d7e
4 changed files with 11 additions and 22 deletions

View File

@@ -48,11 +48,6 @@ class edit extends moodleform {
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
if (get_config('auth_outage', 'default_autostart') !== '2') {
$mform->addElement('checkbox', 'autostart', get_string('autostart', 'auth_outage'));
$mform->addHelpButton('autostart', 'autostart', 'auth_outage');
}
$mform->addElement('duration', 'warningduration', get_string('warningduration', 'auth_outage'));
$mform->addHelpButton('warningduration', 'warningduration', 'auth_outage');
@@ -141,7 +136,7 @@ class edit extends moodleform {
}
$outagedata = [
'id' => ($data->id === 0) ? null : $data->id,
'autostart' => (isset($data->autostart) && ($data->autostart == 1)),
// 'autostart' => (isset($data->autostart) && ($data->autostart == 1)),
'starttime' => $data->starttime,
'stoptime' => $data->starttime + $data->outageduration,
'warntime' => $data->starttime - $data->warningduration,
@@ -166,7 +161,7 @@ class edit extends moodleform {
if ($outage instanceof outage) {
$this->_form->setDefaults([
'id' => $outage->id,
'autostart' => $outage->autostart,
// 'autostart' => $outage->autostart,
'starttime' => $outage->starttime,
'outageduration' => $outage->get_duration_planned(),
'warningduration' => $outage->get_warning_duration(),

View File

@@ -75,5 +75,14 @@ function xmldb_auth_outage_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2026011301, 'auth', 'outage');
}
if ($oldversion < 2024081902) {
// Removing the default_autostart config as it is no longer used.
unset_config('default_autostart', 'auth_outage');
// Outage savepoint reached.
upgrade_plugin_savepoint(true, 2024081902, 'auth', 'outage');
}
return true;
}

View File

@@ -32,9 +32,6 @@ $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['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";

View File

@@ -43,18 +43,6 @@ if ($hassiteconfig) {
get_string('settingssectiondefaultsdescription', 'auth_outage') . $description
));
$settings->add(new admin_setting_configselect(
'auth_outage/default_autostart',
get_string('defaultoutageautostart', 'auth_outage'),
get_string('defaultoutageautostartdescription', 'auth_outage'),
'0',
[
'0' => get_string('autostartoff', 'auth_outage'),
'1' => get_string('autostarton', 'auth_outage'),
'2' => get_string('autostartforcedoff', 'auth_outage'),
]
));
$settings->add(new admin_setting_configduration(
'auth_outage/default_warning_duration',
get_string('defaultwarningduration', 'auth_outage'),