From b1f1bd2e542a617b8c8a8781e0344c25fc9a70d1 Mon Sep 17 00:00:00 2001 From: Sara Arjona Date: Thu, 10 May 2018 09:47:53 +0200 Subject: [PATCH] MDL-61714 admin: Update digital age consent map according legislation --- admin/settings/users.php | 27 +++++++++------------------ lib/db/upgrade.php | 15 +++++++++++++++ version.php | 2 +- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/admin/settings/users.php b/admin/settings/users.php index 465a9d7056f..ac9c15ba527 100644 --- a/admin/settings/users.php +++ b/admin/settings/users.php @@ -228,27 +228,18 @@ if ($hassiteconfig) { $setting->set_force_ltr(true); $temp->add($setting); + // See {@link https://gdpr-info.eu/art-8-gdpr/}. + $ageofdigitalconsentmap = implode(PHP_EOL, [ + '*, 16', + 'AT, 14', + 'ES, 14', + 'SI, 14', + 'US, 13' + ]); $setting = new admin_setting_agedigitalconsentmap('agedigitalconsentmap', new lang_string('ageofdigitalconsentmap', 'admin'), new lang_string('ageofdigitalconsentmap_desc', 'admin'), - // See {@link https://gdpr-info.eu/art-8-gdpr/}. - implode(PHP_EOL, [ - '*, 16', - 'AT, 14', - 'CZ, 13', - 'DE, 14', - 'DK, 13', - 'ES, 13', - 'FI, 15', - 'GB, 13', - 'HU, 14', - 'IE, 13', - 'LT, 16', - 'LU, 16', - 'NL, 16', - 'PL, 13', - 'SE, 13', - ]), + $ageofdigitalconsentmap, PARAM_RAW ); $temp->add($setting); diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index edafff2028b..ad633f782d9 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -2216,5 +2216,20 @@ function xmldb_main_upgrade($oldversion) { upgrade_main_savepoint(true, 2018040500.01); } + if ($oldversion < 2018050800.02) { + // Update default digital age consent map according to the current legislation on each country. + $ageofdigitalconsentmap = implode(PHP_EOL, [ + '*, 16', + 'AT, 14', + 'ES, 14', + 'SI, 14', + 'US, 13' + ]); + set_config('agedigitalconsentmap', $ageofdigitalconsentmap); + + // Main savepoint reached. + upgrade_main_savepoint(true, 2018050800.02); + } + return true; } diff --git a/version.php b/version.php index 84769758914..8288017d934 100644 --- a/version.php +++ b/version.php @@ -29,7 +29,7 @@ defined('MOODLE_INTERNAL') || die(); -$version = 2018050800.01; // YYYYMMDD = weekly release date of this DEV branch. +$version = 2018050800.02; // YYYYMMDD = weekly release date of this DEV branch. // RR = release increments - 00 in DEV branches. // .XX = incremental changes. -- 2.11.4.GIT