diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a663f92..ef23d2d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,10 @@ +# .github/workflows/ci.yml name: ci on: [push, pull_request] jobs: - test: - uses: catalyst/catalyst-moodle-workflows/.github/workflows/group-39-plus-ci.yml@main + ci: + uses: catalyst/catalyst-moodle-workflows/.github/workflows/ci.yml@main with: disable_behat: true diff --git a/README.md b/README.md index 3ac8e97..b50ee46 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://github.com/catalyst/moodle-auth_outage/workflows/Run%20all%20tests%20for%20Moodle%2039+/badge.svg)](https://github.com/catalyst/moodle-auth_outage/actions) +![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/catalyst/moodle-auth_outage/ci.yml?branch=MOODLE_39_STABLE) # Moodle Outage manager plugin * [Version Support](#version-support) diff --git a/settings.php b/settings.php index cfb919e..068986c 100644 --- a/settings.php +++ b/settings.php @@ -26,25 +26,30 @@ * @var admin_settingpage $settings * @var bootstrap_renderer $OUTPUT * @var admin_root $ADMIN + * @var moodle_page $PAGE */ use auth_outage\local\outagelib; defined('MOODLE_INTERNAL') || die; -if ($hassiteconfig && is_enabled_auth('outage')) { +if ($hassiteconfig) { $defaults = outagelib::get_config_defaults(); $settings->visiblename = get_string('menusettings', 'auth_outage'); + $description = outagelib::generate_plugin_configuration_warning(); $settings->add(new admin_setting_heading( 'defaults', get_string('settingssectiondefaults', 'auth_outage'), - get_string('settingssectiondefaultsdescription', 'auth_outage'))); + get_string('settingssectiondefaultsdescription', 'auth_outage') . $description + )); + $settings->add(new admin_setting_configcheckbox( 'auth_outage/default_autostart', get_string('defaultoutageautostart', 'auth_outage'), get_string('defaultoutageautostartdescription', 'auth_outage'), $defaults['default_autostart'] )); + $settings->add(new admin_setting_configduration( 'auth_outage/default_warning_duration', get_string('defaultwarningduration', 'auth_outage'), @@ -96,21 +101,22 @@ if ($hassiteconfig && is_enabled_auth('outage')) { // Create 'Allowed IPs' settings. $allowedips = outagelib::get_config()->allowedips; - $description = outagelib::generate_plugin_configuration_warning(); if (trim($allowedips) == '') { $message = 'allowedipsempty'; $type = 'notifymessage'; - } else if (remoteip_in_list($allowedips)) { - $message = 'allowedipshasmyip'; - $type = 'notifysuccess'; } else { - $message = 'allowedipshasntmyip'; - $type = 'notifyerror'; + if (remoteip_in_list($allowedips)) { + $message = 'allowedipshasmyip'; + $type = 'notifysuccess'; + } else { + $message = 'allowedipshasntmyip'; + $type = 'notifyerror'; + } }; - $description .= $OUTPUT->notification(get_string($message, 'auth_outage', ['ip' => getremoteaddr()]), $type); + $description = $OUTPUT->notification(get_string($message, 'auth_outage', ['ip' => getremoteaddr()]), $type); - $description .= '

'.get_string('ipblockersyntax', 'admin').'

'; - $description .= '

'.get_string('ips_combine', 'auth_outage').'

'; + $description .= '

' . get_string('ipblockersyntax', 'admin') . '

'; + $description .= '

' . get_string('ips_combine', 'auth_outage') . '

'; $iplist = new admin_setting_configiplist( 'auth_outage/allowedips', @@ -150,7 +156,7 @@ if ($hassiteconfig && is_enabled_auth('outage')) { new admin_externalpage( 'auth_outage_manage', get_string('menumanage', 'auth_outage'), - new moodle_url($CFG->wwwroot.'/auth/outage/manage.php') + new moodle_url($CFG->wwwroot . '/auth/outage/manage.php') ) ); } diff --git a/version.php b/version.php index dd71866..801be6d 100644 --- a/version.php +++ b/version.php @@ -28,8 +28,8 @@ defined('MOODLE_INTERNAL') || die(); $plugin->component = "auth_outage"; -$plugin->version = 2022121900; // The current plugin version (Date: YYYYMMDDXX). -$plugin->release = 2022121900; // Human-readable release information. +$plugin->version = 2023012700; // The current plugin version (Date: YYYYMMDDXX). +$plugin->release = 2023012700; // 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. +$plugin->supported = [39, 401]; // A range of branch numbers of supported moodle versions.