MDL-73397 adminpresets: Move sensiblesettings to core

The sensiblesettings setting has been moved from tool_admin_presets
to adminpresets component where it belongs, in order for being able
to use it from the API to decide whether sensible settings should
be included when exporting them.
This commit is contained in:
Sara Arjona 2021-12-23 12:10:00 +01:00 committed by Amaia Anabitarte
parent 8bf52e3195
commit 1f47ef1a34
7 changed files with 31 additions and 27 deletions

View file

@ -84,8 +84,6 @@ $string['rollbackfailures'] = 'The following settings can not be restored, the a
$string['rollbackresults'] = 'Settings successfully restored';
$string['rollbackshow'] = '{$a} preset version history';
$string['selectfile'] = 'Select file';
$string['sensiblesettings'] = 'Settings with passwords';
$string['sensiblesettingstext'] = 'Settings with passwords or other sensitive information can be excluded when creating a site admin preset. Enter additional settings with format SETTINGNAME@@PLUGINNAME separated by commas.';
$string['settingname'] = 'Setting name';
$string['settingsapplied'] = 'Setting changes';
$string['settingsappliednotification'] = 'Review the following setting changes which have been applied.

View file

@ -26,27 +26,7 @@
defined('MOODLE_INTERNAL') || die();
if ($hassiteconfig) {
$ADMIN->add('root', new admin_externalpage('tool_admin_presets',
get_string('pluginname', 'tool_admin_presets'),
new moodle_url('/admin/tool/admin_presets/index.php')));
$settings = new admin_settingpage('tool_admin_presets_settings', get_string('pluginname', 'tool_admin_presets'));
$ADMIN->add('tools', $settings);
$sensiblesettingsdefault = 'recaptchapublickey@@none, recaptchaprivatekey@@none, googlemapkey3@@none, ';
$sensiblesettingsdefault .= 'secretphrase@@url, cronremotepassword@@none, smtpuser@@none, ';
$sensiblesettingsdefault .= 'smtppass@none, proxypassword@@none, quizpassword@@quiz, allowedip@@none, blockedip@@none, ';
$sensiblesettingsdefault .= 'dbpass@@logstore_database, messageinbound_hostpass@@none, ';
$sensiblesettingsdefault .= 'bind_pw@@auth_cas, pass@@auth_db, bind_pw@@auth_ldap, ';
$sensiblesettingsdefault .= 'dbpass@@enrol_database, bind_pw@@enrol_ldap, ';
$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';
$settings->add(new admin_setting_configtextarea('tool_admin_presets/sensiblesettings',
get_string('sensiblesettings', 'tool_admin_presets'),
get_string('sensiblesettingstext', 'tool_admin_presets'),
$sensiblesettingsdefault, PARAM_TEXT));
}