diff --git a/public/language/en-GB/register.json b/public/language/en-GB/register.json index 81b20421d4..0611f4b878 100644 --- a/public/language/en-GB/register.json +++ b/public/language/en-GB/register.json @@ -19,5 +19,14 @@ "terms_of_use_error": "You must agree to the Terms of Use", "registration-added-to-queue": "Your registration has been added to the approval queue. You will receive an email when it is accepted by an administrator.", "interstitial.intro": "We require some additional information before we can create your account.", - "interstitial.errors-found": "We could not complete your registration:" + "interstitial.errors-found": "We could not complete your registration:", + + "gdpr_lead": "This community forum collects and processes your personal information.", + "gdpr_intro": "We use this information strictly to personalise your experience in this community, as well as to associate the posts you make to your user account. During the registration step you were asked to provide a username and email address, you can also optionally provide additional information to complete your user profile on this website.

We retain this information for the life of your user account, and you are able to withdraw consent at any time by deleting your account. At any time you may request a copy of your contribution to this website, via your user settings page.

If you have any questions or concerns, we encourage you to reach out to this forum's administrative team.", + "gdpr_email_intro": "Occasionally, we may send emails to your registered email address in order to provide updates and/or to notify you of new activity that is pertinent to you. You can customise the frequency of the community digest (including disabling it outright), as well as select which types of notifications to receive via email.", + "gdpr_digest_frequency": "By default, this community delivers email digests every %1.", + "gdpr_digest_off": "Currently, this community does not send out email digests", + "gdpr_agree_data": "I consent to the collection and processing of my personal information on this website.", + "gdpr_agree_email": "I consent to receive digest and notification emails from this website.", + "gdpr_consent_denied": "You must give consent to this site to collect/process your information, and to send you emails." } \ No newline at end of file diff --git a/src/user.js b/src/user.js index caf47fdcb9..f81c08f280 100644 --- a/src/user.js +++ b/src/user.js @@ -348,25 +348,50 @@ User.getModeratedCids = function (uid, callback) { User.addInterstitials = function (callback) { plugins.registerHook('core', { hook: 'filter:register.interstitial', - method: function (data, callback) { - if (meta.config.termsOfUse && !data.userData.acceptTos) { - data.interstitials.push({ - template: 'partials/acceptTos', - data: { - termsOfUse: meta.config.termsOfUse, - }, - callback: function (userData, formData, next) { - if (formData['agree-terms'] === 'on') { - userData.acceptTos = true; - } - - next(userData.acceptTos ? null : new Error('[[register:terms_of_use_error]]')); - }, - }); - } + method: [ + // GDPR information collection/processing consent + email consent + function (data, callback) { + if (!data.userData.gdpr_consent) { + data.interstitials.push({ + template: 'partials/gdpr_consent', + data: { + digestFrequency: meta.config.dailyDigestFreq, + digestEnabled: meta.config.dailyDigestFreq !== 'off', + }, + callback: function (userData, formData, next) { + if (formData.gdpr_agree_data === 'on' && formData.gdpr_agree_email === 'on') { + userData.gdpr_consent = true; + } + + next(userData.gdpr_consent ? null : new Error('[[register:gdpr_consent_denied]]')); + }, + }); + } - callback(null, data); - }, + setImmediate(callback, null, data); + }, + + // Forum Terms of Use + function (data, callback) { + if (meta.config.termsOfUse && !data.userData.acceptTos) { + data.interstitials.push({ + template: 'partials/acceptTos', + data: { + termsOfUse: meta.config.termsOfUse, + }, + callback: function (userData, formData, next) { + if (formData['agree-terms'] === 'on') { + userData.acceptTos = true; + } + + next(userData.acceptTos ? null : new Error('[[register:terms_of_use_error]]')); + }, + }); + } + + setImmediate(callback, null, data); + }, + ], }); callback(); diff --git a/src/user/create.js b/src/user/create.js index f2a9b87f55..d6718e8a4d 100644 --- a/src/user/create.js +++ b/src/user/create.js @@ -46,6 +46,7 @@ module.exports = function (User) { lastposttime: 0, banned: 0, status: 'online', + gdpr_consent: data.gdpr_consent === true ? 1 : 0, }; User.uniqueUsername(userData, next); diff --git a/src/views/partials/gdpr_consent.tpl b/src/views/partials/gdpr_consent.tpl new file mode 100644 index 0000000000..420f4f3adb --- /dev/null +++ b/src/views/partials/gdpr_consent.tpl @@ -0,0 +1,23 @@ +
+

[[register:gdpr_lead]]

+

[[register:gdpr_intro]]

+
+ +
+

+ [[register:gdpr_email_intro]] + + [[register:gdpr_digest_frequency, {digestFrequency}]] + + [[register:gdpr_digest_off]] + +

+ +
+ +
+
\ No newline at end of file