MDL-79373 admin: ensure all current password configs are defined.

Ensure the admin preset export tool has an accurate record of each,
to be observed as sensitive settings when creating an export.
This commit is contained in:
Paul Holden 2023-09-15 13:28:41 +01:00 committed by Huong Nguyen
parent 5d2ce59559
commit 19ad8459d7
No known key found for this signature in database
GPG Key ID: 40D88AB693A3E72A
3 changed files with 19 additions and 2 deletions

View File

@ -152,7 +152,8 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$sensiblesettingsdefault .= 'server_password@@search_solr, ssl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'alternateserver_password@@search_solr, alternatessl_keypassword@@search_solr, ';
$sensiblesettingsdefault .= 'test_password@@cachestore_redis, password@@mlbackend_python, ';
$sensiblesettingsdefault .= 'badges_badgesalt@@none, calendar_exportsalt@@none';
$sensiblesettingsdefault .= 'badges_badgesalt@@none, calendar_exportsalt@@none, ';
$sensiblesettingsdefault .= 'bigbluebuttonbn_shared_secret@@none';
$temp->add(new admin_setting_configtextarea('adminpresets/sensiblesettings',
get_string('sensiblesettings', 'core_adminpresets'),
get_string('sensiblesettingstext', 'core_adminpresets'),

View File

@ -3111,5 +3111,21 @@ privatefiles,moodle|/user/files.php';
upgrade_main_savepoint(true, 2022112805.14);
}
if ($oldversion < 2022112811.09) {
// Fix missing default admin presets "sensible settings" (those that should be treated as sensitive).
$newsensiblesetting = 'bigbluebuttonbn_shared_secret@@none';
$sensiblesettings = get_config('adminpresets', 'sensiblesettings');
if (strpos($sensiblesettings, $newsensiblesetting) === false) {
$sensiblesettings .= ", {$newsensiblesetting}";
}
set_config('sensiblesettings', $sensiblesettings, 'adminpresets');
// Main savepoint reached.
upgrade_main_savepoint(true, 2022112811.09);
}
return true;
}

View File

@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
$version = 2022112811.08; // 20221128 = branching date YYYYMMDD - do not modify!
$version = 2022112811.09; // 20221128 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches.
// .XX = incremental changes.
$release = '4.1.11+ (Build: 20240802)'; // Human-friendly version name