From af66d28d35d11012b1747822b1e67b8a1b0ed8d7 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Mon, 3 Jun 2019 16:16:47 +0100 Subject: [PATCH] DO NOT INTEGRATE - Silly commit for testing --- admin/settings/server.php | 3 +++ admin/tests/behat/encrypted_admin_setting.feature | 13 +++++++++++++ index.php | 2 ++ 3 files changed, 18 insertions(+) create mode 100644 admin/tests/behat/encrypted_admin_setting.feature diff --git a/admin/settings/server.php b/admin/settings/server.php index a869ce6294dc3..d8c5ce1022b2a 100644 --- a/admin/settings/server.php +++ b/admin/settings/server.php @@ -170,6 +170,9 @@ 168 => new lang_string('numdays', '', 7), ))); +// 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); diff --git a/admin/tests/behat/encrypted_admin_setting.feature b/admin/tests/behat/encrypted_admin_setting.feature new file mode 100644 index 0000000000000..63fdc23f9f0e6 --- /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 01b2b5ffb4c35..506ef4b944d07 100644 --- a/index.php +++ b/index.php @@ -111,6 +111,8 @@ $courserenderer = $PAGE->get_renderer('core', 'course'); echo $OUTPUT->header(); +print_object('The silly password is: ' . \core_admin\setting_encryption::decrypt($CFG->sillypassword)); + $siteformatoptions = course_get_format($SITE)->get_format_options(); $modinfo = get_fast_modinfo($SITE); $modnamesused = $modinfo->get_used_module_names();