Skip to content

Commit

Permalink
MDL-46269 tool_httpsreplace: Add more info and warnings about the tool
Browse files Browse the repository at this point in the history
  • Loading branch information
xow authored and marinaglancy committed Oct 16, 2017
1 parent f7e6fb0 commit c74748c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
4 changes: 4 additions & 0 deletions admin/tool/httpsreplace/cli/url_finder.php
Expand Up @@ -41,6 +41,10 @@
exit(0);
}

if (!is_https()) {
echo $OUTPUT->notification(get_string('httpwarning', 'tool_httpsreplace'), 'warning');
}

$urlfinder = new \tool_httpsreplace\url_finder();
$results = $urlfinder->http_link_stats();
$fp = fopen('php://stdout', 'w');
Expand Down
4 changes: 4 additions & 0 deletions admin/tool/httpsreplace/cli/url_replace.php
Expand Up @@ -41,5 +41,9 @@
exit(0);
}

if (!is_https()) {
echo $OUTPUT->notification(get_string('httpwarning', 'tool_httpsreplace'), 'warning');
}

$urlfinder = new \tool_httpsreplace\url_finder();
$urlfinder->upgrade_http_links();
7 changes: 4 additions & 3 deletions admin/tool/httpsreplace/index.php
Expand Up @@ -50,9 +50,9 @@
die;
}

echo $OUTPUT->box_start();
echo $OUTPUT->notification(get_string('takeabackupwarning', 'tool_httpsreplace'));
echo $OUTPUT->box_end();
if (!is_https()) {
echo $OUTPUT->notification(get_string('httpwarning', 'tool_httpsreplace'), 'warning');
}


$form = new \tool_httpsreplace\form();
Expand Down Expand Up @@ -89,6 +89,7 @@
$table->data = $data;
echo html_writer::table($table);
}
echo $OUTPUT->notification(get_string('takeabackupwarning', 'tool_httpsreplace'), 'warning');
$form->display();
} else {
// Scroll to the end when finished.
Expand Down
14 changes: 8 additions & 6 deletions admin/tool/httpsreplace/lang/en/tool_httpsreplace.php
Expand Up @@ -28,12 +28,14 @@
$string['doclink'] = 'Read more documentation on the wiki';
$string['doit'] = 'Perform replacement';
$string['domain'] = 'Problematic domain';
$string['domainexplain'] = 'When an instance is moved from http to https, all embeded http content will stop working. This tool always you to automatically convert the http content to https. Below is a report of content that may not work once you run this script. You may want to check each one has https available or find alternative resources.';
$string['domainexplainhelp'] = 'These domains are found in your content, but do not appear to support https content. After switching to https, the content included from these sites will no longer display within Moodle for users with secure modern browsers. It is possible that these sites are temporarily or permanently unavailable and will not work with either security setting. Proceed only after reviewing these results and determining if this externally hosted content is non-essential.';
$string['domainexplain'] = 'When an instance is moved from HTTP to HTTPS, all embeded HTTP content will stop working. This tool always you to automatically convert the HTTP content to HTTPS. Below is a report of content that may not work once you run this script. You may want to check each one has HTTPS available or find alternative resources.';
$string['domainexplainhelp'] = 'These domains are found in your content, but do not appear to support HTTPS content. After switching to HTTPS, the content included from these sites will no longer display within Moodle for users with secure modern browsers. It is possible that these sites are temporarily or permanently unavailable and will not work with either security setting. Proceed only after reviewing these results and determining if this externally hosted content is non-essential.';
$string['httpwarning'] = 'This instance is still running on HTTP. You can still run this tool and external content will be changed to HTTPS, but internal content will remain on HTTP. You will need to run this script again after switching to HTTPS to convert internal content.';
$string['notimplemented'] = 'Sorry, this feature is not implemented in your database driver.';
$string['oktoprocede'] = 'The scan finds no issues with your content. You can proceed to upgrade any http content to use https.';
$string['pageheader'] = 'Upgrade externally hosted content urls to https';
$string['oktoprocede'] = 'The scan finds no issues with your content. You can proceed to upgrade any HTTP content to use HTTPS.';
$string['pageheader'] = 'Upgrade externally hosted content urls to HTTPS';
$string['pluginname'] = 'HTTPS conversion tool';
$string['replacing'] = 'Replacing http content with https...';
$string['replacing'] = 'Replacing HTTP content with HTTPS...';
$string['searching'] = 'Searching {$a}';
$string['takeabackupwarning'] = 'Once this tool run, changes made can\'t be reverted. A complete backup should be made before running this script! There is a low risk that the wrong content will be replaced, introducing problems.';
$string['takeabackupwarning'] = 'Once this is tool run, changes made can\'t be reverted. A complete backup should be made before running this script. There is a low risk that the wrong content will be replaced, introducing problems.';
$string['toolintro'] = 'If you are planning on converting your site to HTTPS, you can use the <a href="{$a}">HTTPS conversion tool</a> to convert your embeded content to HTTPS.';

0 comments on commit c74748c

Please sign in to comment.