MDL-46269 tool_httpsreplace: Make standard plugin & add to settings

This commit is contained in:
John Okely
2017-08-30 15:06:04 +08:00
committed by Marina Glancy
parent e3b853a79f
commit f7e6fb04db
4 changed files with 17 additions and 5 deletions

View File

@@ -106,7 +106,7 @@ if (!$data = $form->get_data()) {
$progressbar->update_full(100, get_string('complete', 'tool_httpsreplace')); $progressbar->update_full(100, get_string('complete', 'tool_httpsreplace'));
echo $OUTPUT->continue_button(new moodle_url('/admin/index.php')); echo $OUTPUT->continue_button(new moodle_url('/admin/settings.php', ['section' => 'httpsecurity']));
} }
echo $OUTPUT->footer(); echo $OUTPUT->footer();

View File

@@ -28,5 +28,15 @@ if ($hassiteconfig) {
$pluginname = get_string('pluginname', 'tool_httpsreplace'); $pluginname = get_string('pluginname', 'tool_httpsreplace');
$url = $CFG->wwwroot.'/'.$CFG->admin.'/tool/httpsreplace/index.php'; $url = $CFG->wwwroot.'/'.$CFG->admin.'/tool/httpsreplace/index.php';
$ADMIN->add('security', new admin_externalpage('toolhttpsreplace', $pluginname, $url, 'moodle/site:config')); $ADMIN->add('security', new admin_externalpage('toolhttpsreplace', $pluginname, $url, 'moodle/site:config', true));
$httpsreplaceurl = $CFG->wwwroot.'/'.$CFG->admin.'/tool/httpsreplace/index.php';
$ADMIN->locate('httpsecurity')->add(
new admin_setting_heading(
'tool_httpsreplaceheader',
new lang_string('pluginname', 'tool_httpsreplace'),
new lang_string('toolintro', 'tool_httpsreplace', $httpsreplaceurl)
)
);
} }

View File

@@ -13,12 +13,14 @@ Feature: View the httpsreplace report
@javascript @javascript
Scenario: Go to the HTTPS replace report screen. Make sure broken domains are reported. Scenario: Go to the HTTPS replace report screen. Make sure broken domains are reported.
When I navigate to "HTTPS replace" node in "Site administration > Security" When I navigate to "HTTP security" node in "Site administration > Security"
And I follow "HTTPS conversion tool"
Then I should see "intentionally.unavailable" Then I should see "intentionally.unavailable"
@javascript @javascript
Scenario: Use the find and replace tool. Scenario: Use the find and replace tool.
When I navigate to "HTTPS replace" node in "Site administration > Security" When I navigate to "HTTP security" node in "Site administration > Security"
And I follow "HTTPS conversion tool"
And I set the field "I understand the risks of this operation" to "1" And I set the field "I understand the risks of this operation" to "1"
And I press "Perform replacement" And I press "Perform replacement"
Then I should see "intentionally.unavailable" Then I should see "intentionally.unavailable"

View File

@@ -1905,7 +1905,7 @@ class core_plugin_manager {
'tool' => array( 'tool' => array(
'analytics', 'assignmentupgrade', 'availabilityconditions', 'behat', 'capability', 'cohortroles', 'customlang', 'analytics', 'assignmentupgrade', 'availabilityconditions', 'behat', 'capability', 'cohortroles', 'customlang',
'dbtransfer', 'filetypes', 'generator', 'health', 'innodb', 'installaddon', 'dbtransfer', 'filetypes', 'generator', 'health', 'httpsreplace', 'innodb', 'installaddon',
'langimport', 'log', 'lp', 'lpimportcsv', 'lpmigrate', 'messageinbound', 'mobile', 'multilangupgrade', 'langimport', 'log', 'lp', 'lpimportcsv', 'lpmigrate', 'messageinbound', 'mobile', 'multilangupgrade',
'monitor', 'oauth2', 'phpunit', 'profiling', 'recyclebin', 'replace', 'spamcleaner', 'task', 'templatelibrary', 'monitor', 'oauth2', 'phpunit', 'profiling', 'recyclebin', 'replace', 'spamcleaner', 'task', 'templatelibrary',
'unittest', 'uploadcourse', 'uploaduser', 'unsuproles', 'usertours', 'xmldb' 'unittest', 'uploadcourse', 'uploaduser', 'unsuproles', 'usertours', 'xmldb'