diff --git a/admin/settings/server.php b/admin/settings/server.php index 11541bb6d65..86de502e273 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -232,6 +232,9 @@ if ($hassiteconfig) { ] )); + // TEST CODE: Add an encrypted password setting. + $temp->add(new admin_setting_encryptedpassword('sillypassword', 'Silly password', 'This is a silly password just to test the encryption')); + $ADMIN->add('server', $temp); $temp->add(new admin_setting_configduration('filescleanupperiod', diff --git a/admin/tests/behat/encrypted_admin_setting.feature b/admin/tests/behat/encrypted_admin_setting.feature new file mode 100644 index 00000000000..63fdc23f9f0 --- /dev/null +++ b/admin/tests/behat/encrypted_admin_setting.feature @@ -0,0 +1,13 @@ +@core @core_admin @mdl65818 +Feature: Encrypted admin setting UI works + In order to edit encrypted admin settings + As an admin + I need for the admin editing interface to actually work + + Scenario: Set the admin setting with Behat step + When the following config values are set as admin: + | sillypassword | Frogs! | | encrypted | + And I log in as "admin" + And I am on site homepage + Then I should see "The silly password is: Frogs!" + diff --git a/index.php b/index.php index 2346d39b54e..fa1f96357a4 100644 --- a/index.php +++ b/index.php @@ -99,6 +99,8 @@ $PAGE->set_heading($SITE->fullname); $courserenderer = $PAGE->get_renderer('core', 'course'); echo $OUTPUT->header(); +print_object('The silly password is: ' . \core\encryption::decrypt($CFG->sillypassword)); + $siteformatoptions = course_get_format($SITE)->get_format_options(); $modinfo = get_fast_modinfo($SITE); $modnamesused = $modinfo->get_used_module_names();