Merge branch 'MDL-85116-405' of https://github.com/junpataleta/moodle into MOODLE_405_STABLE
This commit is contained in:
@@ -76,18 +76,24 @@ function xmldb_factor_sms_upgrade(int $oldversion): bool {
|
||||
// Automatically generated Moodle v4.5.0 release upgrade line.
|
||||
// Put any upgrade step following this.
|
||||
|
||||
if ($oldversion < 2024100701) {
|
||||
if ($oldversion < 2024100702) {
|
||||
// Ensure default values are applied for the MFA SMS factor when upgrading.
|
||||
$config = get_config('factor_sms');
|
||||
if ((int)$config->weight === 0) {
|
||||
|
||||
// Set the weight to the default value (100) if it is misconfigured (e.g. set to 0).
|
||||
$weight = $config->weight ?? null;
|
||||
if (isset($weight) && (int)$weight <= 0) {
|
||||
set_config('weight', 100, 'factor_sms');
|
||||
}
|
||||
if ((int)$config->duration === 0) {
|
||||
|
||||
// Set the duration to the default value (30 minutes) if it is misconfigured (e.g. set to 0).
|
||||
$duration = $config->duration ?? null;
|
||||
if (isset($duration) && (int)$duration <= 0) {
|
||||
set_config('duration', 30 * MINSECS, 'factor_sms');
|
||||
}
|
||||
|
||||
// MFA savepoint reached.
|
||||
upgrade_plugin_savepoint(true, 2024100701, 'factor', 'sms');
|
||||
upgrade_plugin_savepoint(true, 2024100702, 'factor', 'sms');
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$plugin->version = 2024100701; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->version = 2024100702; // The current plugin version (Date: YYYYMMDDXX).
|
||||
$plugin->requires = 2024100100; // Requires this Moodle version.
|
||||
$plugin->component = 'factor_sms'; // Full name of the plugin (used for diagnostics).
|
||||
$plugin->maturity = MATURITY_STABLE;
|
||||
|
||||
Reference in New Issue
Block a user