From be5cc0ba035361b3ebe79bb85a7bee243ac592a6 Mon Sep 17 00:00:00 2001 From: Michael Hawkins Date: Wed, 9 May 2018 11:19:45 +0800 Subject: [PATCH] MDL-61971 dataprivacy: Added warning messages where data request pages are viewed on non-HTTPS sites --- admin/tool/dataprivacy/classes/output/data_requests_page.php | 5 +++++ admin/tool/dataprivacy/classes/output/my_data_requests_page.php | 5 +++++ admin/tool/dataprivacy/lang/en/tool_dataprivacy.php | 1 + admin/tool/dataprivacy/templates/data_requests.mustache | 4 ++++ admin/tool/dataprivacy/templates/my_data_requests.mustache | 4 ++++ 5 files changed, 19 insertions(+) diff --git a/admin/tool/dataprivacy/classes/output/data_requests_page.php b/admin/tool/dataprivacy/classes/output/data_requests_page.php index 572617ca922..c1b2861b809 100644 --- a/admin/tool/dataprivacy/classes/output/data_requests_page.php +++ b/admin/tool/dataprivacy/classes/output/data_requests_page.php @@ -73,6 +73,11 @@ class data_requests_page implements renderable, templatable { $data->newdatarequesturl = new moodle_url('/admin/tool/dataprivacy/createdatarequest.php'); $data->newdatarequesturl->param('manage', true); + if (!is_https()) { + $httpwarningmessage = get_string('httpwarning', 'tool_dataprivacy'); + $data->httpsite = array('message' => $httpwarningmessage, 'announce' => 1); + } + $requests = []; foreach ($this->requests as $request) { $requestid = $request->get('id'); diff --git a/admin/tool/dataprivacy/classes/output/my_data_requests_page.php b/admin/tool/dataprivacy/classes/output/my_data_requests_page.php index 0e0da54121f..6b906696ec3 100644 --- a/admin/tool/dataprivacy/classes/output/my_data_requests_page.php +++ b/admin/tool/dataprivacy/classes/output/my_data_requests_page.php @@ -70,6 +70,11 @@ class my_data_requests_page implements renderable, templatable { $data = new stdClass(); $data->newdatarequesturl = new moodle_url('/admin/tool/dataprivacy/createdatarequest.php'); + if (!is_https()) { + $httpwarningmessage = get_string('httpwarning', 'tool_dataprivacy'); + $data->httpsite = array('message' => $httpwarningmessage, 'announce' => 1); + } + $requests = []; foreach ($this->requests as $request) { $requestid = $request->get('id'); diff --git a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php index 999ba5e8ddc..9049e5498a7 100644 --- a/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php +++ b/admin/tool/dataprivacy/lang/en/tool_dataprivacy.php @@ -136,6 +136,7 @@ $string['gdpr_art_9_2_i_name'] = 'Public health (GDPR Art. 9.2(i))'; $string['gdpr_art_9_2_j_description'] = 'Processing is necessary for archiving purposes in the public interest, scientific or historical research purposes or statistical purposes in accordance with Article 89(1) based on Union or Member State law which shall be proportionate to the aim pursued, respect the essence of the right to data protection and provide for suitable and specific measures to safeguard the fundamental rights and the interests of the data subject'; $string['gdpr_art_9_2_j_name'] = 'Public interest, or scientific/historical/statistical research (GDPR Art. 9.2(j))'; $string['hide'] = 'Collapse all'; +$string['httpwarning'] = 'Any data downloaded from this site may not be encrypted. Please contact your system administrator and request that they install SSL on this site.'; $string['inherit'] = 'Inherit'; $string['lawfulbases'] = 'Lawful bases'; $string['lawfulbases_help'] = 'Select at least one option that will serve as the lawful basis for processing personal data. For details on these lawful bases, please see GDPR Art. 6.1'; diff --git a/admin/tool/dataprivacy/templates/data_requests.mustache b/admin/tool/dataprivacy/templates/data_requests.mustache index db2f2ae7a5d..beed5ac81a8 100644 --- a/admin/tool/dataprivacy/templates/data_requests.mustache +++ b/admin/tool/dataprivacy/templates/data_requests.mustache @@ -95,6 +95,10 @@ } }} +{{#httpsite}} + {{> core/notification_warning}} +{{/httpsite}} +