From 34770e55b24a47cf39c1ae79b27e04d385985c6c Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 17 Apr 2017 12:19:36 +0200 Subject: [PATCH 1/2] MDL-54901 environment: 3.3 base information This is a direct copy of the 3.2 branch to have changes under control easier in next commits. --- admin/environment.xml | 165 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) diff --git a/admin/environment.xml b/admin/environment.xml index 38207edf1c2..4ed9863efe9 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -1905,4 +1905,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 3567a373025bec4aeabd37541c40da68774f7b03 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 17 Apr 2017 17:27:07 +0200 Subject: [PATCH 2/2] MDL-54901 environment: pg93, openssl, https & utf8mb4 --- admin/environment.xml | 16 +++++++++++++--- lang/en/admin.php | 2 ++ lib/upgradelib.php | 21 +++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/admin/environment.xml b/admin/environment.xml index 4ed9863efe9..f87521126df 100644 --- a/admin/environment.xml +++ b/admin/environment.xml @@ -1914,7 +1914,7 @@ - + @@ -1941,9 +1941,9 @@ - + - + @@ -2068,6 +2068,16 @@ + + + + + + + + + + diff --git a/lang/en/admin.php b/lang/en/admin.php index 348db8dbc05..06b5a7f6ec8 100644 --- a/lang/en/admin.php +++ b/lang/en/admin.php @@ -621,6 +621,7 @@ $string['iplookupinfo'] = 'By default Moodle uses the free online NetGeo (The In It is recommended to install local copy of free GeoLite2 City database from MaxMind.
IP address location is displayed on simple map or using Google Maps. Please note that you need to have a Google account and apply for free Google Maps API key to enable interactive maps.'; $string['iplookupmaxmindnote'] = 'This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.'; +$string['ishttpswarning'] = 'It has been detected that your site is not secured using HTTPS. For increased security and improved integrations with other systems is highly recommended to migrate your site to HTTPS.'; $string['keeptagnamecase'] = 'Keep tag name casing'; $string['lang'] = 'Default language'; $string['langcache'] = 'Cache language menu'; @@ -799,6 +800,7 @@ $string['numberofstrings'] = 'Total number of strings: {$a->strings}
Missin $string['onlynoreply'] = 'Only when from a no-reply address'; $string['opcacherecommended'] = 'PHP opcode caching improves performance and lowers memory requirements, OPcache extension is recommended and fully supported.'; $string['opensslrecommended'] = 'Installing the optional OpenSSL library is highly recommended -- it enables Moodle Networking functionality.'; +$string['opensslrequired'] = 'The OpenSSL PHP extension is now required by Moodle to provide stronger cryptographic services.'; $string['opentogoogle'] = 'Open to Google'; $string['optionalmaintenancemessage'] = 'Optional maintenance message'; $string['order1'] = 'First'; diff --git a/lib/upgradelib.php b/lib/upgradelib.php index 7fe339b75c9..c2c6c49b231 100644 --- a/lib/upgradelib.php +++ b/lib/upgradelib.php @@ -2246,6 +2246,27 @@ function check_mysql_incomplete_unicode_support(environment_results $result) { return null; } +/** + * Check if the site is being served using an ssl url. + * + * Note this does not really perform any request neither looks for proxies or + * other situations. Just looks to wwwroot and warn if it's not using https. + * + * @param environment_results $result $result + * @return environment_results|null updated results object, or null if the site is https. + */ +function check_is_https(environment_results $result) { + global $CFG; + + // Only if is defined, non-empty and whatever core tell us. + if (!empty($CFG->wwwroot) && !is_https()) { + $result->setInfo('site not https'); + $result->setStatus(false); + return $result; + } + return null; +} + /** * Upgrade the minmaxgrade setting. *