{{{$t "lib.global.link.dataProtectionDeclaration"}}}
From d73ec5f78f80a081a8275364da25aa62a8c208f6 Mon Sep 17 00:00:00 2001
From: davwas
Date: Thu, 7 Sep 2023 21:35:54 +0200
Subject: [PATCH 3/8] update terms of use links
---
controllers/firstLogin.js | 11 ++++++++---
locales/de.json | 2 +-
locales/en.json | 2 +-
locales/es.json | 2 +-
locales/uk.json | 2 +-
theme/brb/views/lib/extended_footer.hbs | 2 +-
theme/brb/views/lib/footer.hbs | 2 +-
theme/n21/views/lib/extended_footer.hbs | 2 +-
theme/n21/views/lib/footer.hbs | 2 +-
theme/thr/views/lib/extended_footer.hbs | 2 +-
theme/thr/views/lib/footer.hbs | 2 +-
views/firstLogin/sections/consent_updates.hbs | 2 +-
views/registration/forms/einwilligungserklaerung.hbs | 6 +++++-
13 files changed, 24 insertions(+), 15 deletions(-)
diff --git a/controllers/firstLogin.js b/controllers/firstLogin.js
index 9140f9b838..5f532f7a96 100644
--- a/controllers/firstLogin.js
+++ b/controllers/firstLogin.js
@@ -29,10 +29,14 @@ const hasAccount = (req, res) => api(req).get('/consents', {
},
});
-const getSchoolPrivacy = async (req, res) => {
+const getSchoolConsentVersionByType = async (req, res, consentType) => {
+ if (consentType !== 'privacy' || consentType !== 'termsOfUse') {
+ return undefined;
+ }
+
const qs = {
schoolId: res.locals.currentUser.schoolId,
- consentTypes: ['privacy'],
+ consentTypes: [consentType],
consentDataId: { $exists: true },
$limit: 1,
$sort: {
@@ -249,7 +253,8 @@ router.get('/', async (req, res, next) => {
sso: !!(res.locals.currentPayload || {}).systemId,
now: Date.now(),
sections: sections.map((name) => `firstLogin/sections/${name}`),
- schoolPrivacyLink: await getSchoolPrivacy(req, res),
+ schoolPrivacyLink: await getSchoolConsentVersionByType(req, res, 'privacy'),
+ schoolTermsLink: await getSchoolConsentVersionByType(req, res, 'termsOfUse'),
schoolPrivacyName: res.$t('global.text.dataProtection'),
submitPageIndex,
userConsent,
diff --git a/locales/de.json b/locales/de.json
index c88e30550b..ca31789daf 100644
--- a/locales/de.json
+++ b/locales/de.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "Wenn du zwischen 14 und {{age}} Jahre alt bist, bestätige bitte zusätzlich die Einverständniserklärung, damit du die {{title}} nutzen kannst.",
- "agreeTermsOfUse": "Ich habe die Nutzungsordnung der {{title}} gelesen und stimme ihr zu.",
+ "agreeTermsOfUse": "Ich habe die Nutzungsordnung der {{title}} gelesen und stimme ihr zu.",
"andAuthorisedToRepresent": "und berechtigt, den anderen Elternteil bei den nachfolgenden Erklärungen zu vertreten.",
"iAgreeThatThepersonalData": "Ich erkläre mich damit einverstanden, dass die personenbezogenen Daten meines Kindes entsprechend der",
"invalidLink": "Der Link ist leider nicht mehr gültig. Fordere einen neuen Link von deiner Lehrkraft oder dem Schul-Admin an.",
diff --git a/locales/en.json b/locales/en.json
index 09f278f67f..3fb5a5dc45 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "If you are between 14 and {{age}} years old, please also confirm the declaration of consent so that you can use the {{title}}.",
- "agreeTermsOfUse": "I have read and agree to the Terms of Use of the {{title}}.",
+ "agreeTermsOfUse": "I have read and agree to the Terms of Use of the {{title}}.",
"andAuthorisedToRepresent": "and entitled to represent the other parent in the following declarations.",
"iAgreeThatThepersonalData": "I consent to my child's personal data being processed in accordance with the",
"invalidLink": "Unfortunately the link is no longer valid. Request a new link from your teacher or school administrator.",
diff --git a/locales/es.json b/locales/es.json
index b501f4ed66..41a5647519 100644
--- a/locales/es.json
+++ b/locales/es.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "Si tienes entre 14 y {{age}} años, confirma también la declaración de consentimiento para que puedas utilizar {{title}}.",
- "agreeTermsOfUse": "He leído y acepto las Condiciones de uso de {{title}}.",
+ "agreeTermsOfUse": "He leído y acepto las Condiciones de uso de {{title}}.",
"andAuthorisedToRepresent": "y con derecho a representar al otro padre en las siguientes declaraciones.",
"iAgreeThatThepersonalData": "Doy mi consentimiento para que los datos personales de mi hijo sean procesados de acuerdo con la",
"invalidLink": "Desafortunadamente el enlace ya no es válido. Solicita un nuevo enlace a tu profesor o al administrador de la escuela.",
diff --git a/locales/uk.json b/locales/uk.json
index 599c947c37..a0fb5fc54a 100644
--- a/locales/uk.json
+++ b/locales/uk.json
@@ -2448,7 +2448,7 @@
"unknownError": "Ой, сталася невідома помилка. Спробуйте ще раз.",
"welcomeMailSubject": "Ласкаво просимо до {{title}}!",
"welcomeMailText": "Вітаємо, {{firstName}}!\n Ви можете ввійти до {{title}}, використовуючи такі дані для входу в систему:\n Адреса: {{address}}\n Електронна пошта: {{email}}\n {{password}}\n {{infotext}}\n Ваша\n команда {{shortTitle}} бажає вам веселощів та гарного початку",
- "agreeTermsOfUse": "Я прочитав і погоджуюся з Умовами використання{{title}}.",
+ "agreeTermsOfUse": "Я прочитав і погоджуюся з Умовами використання{{title}}.",
"invalidLink": "На жаль, посилання більше не дійсне. Попросіть нове посилання у свого викладача або адміністратора школи.",
"invalidLinkEmbeddedWebsite": "Шкільна хмара була вбудована у веб-сайт. Щоби продовжити ",
"invalidLinkOpenWebsite": "Відкрийте цю сторінку в окремому вікні"
diff --git a/theme/brb/views/lib/extended_footer.hbs b/theme/brb/views/lib/extended_footer.hbs
index c81bfe073b..521f43f55d 100644
--- a/theme/brb/views/lib/extended_footer.hbs
+++ b/theme/brb/views/lib/extended_footer.hbs
@@ -26,7 +26,7 @@
{{$t "firstLogin.consent.text.forAnEvenBetterLearningExperience" (dict "title" @root.theme.title)}}
- {{#ifCond @root.updatedConsents.termsOfUse.total '>' 0}} {{$t "firstLogin.consent.text.the" }} {{$t "firstLogin.consent.text.termsOfUse" }}{{/ifCond}}
+ {{#ifCond @root.updatedConsents.termsOfUse.total '>' 0}} {{$t "firstLogin.consent.text.the" }} {{$t "firstLogin.consent.text.termsOfUse" }}{{/ifCond}}
{{#ifCond @root.updatedConsents.privacy.total '>' 0}}
{{#ifCond @root.updatedConsents.termsOfUse.total '>' 0}}
{{$t "firstLogin.consent.text.and" }}
diff --git a/views/registration/forms/einwilligungserklaerung.hbs b/views/registration/forms/einwilligungserklaerung.hbs
index 17e3ff568a..213df5a899 100644
--- a/views/registration/forms/einwilligungserklaerung.hbs
+++ b/views/registration/forms/einwilligungserklaerung.hbs
@@ -28,5 +28,9 @@
From f48184aa159c4989face9a88f1d6017381da9977 Mon Sep 17 00:00:00 2001
From: davwas
Date: Thu, 7 Sep 2023 22:53:37 +0200
Subject: [PATCH 4/8] update other terms of use links
---
controllers/firstLogin.js | 2 +-
controllers/registration.js | 28 ++++++++++++-------
locales/de.json | 2 +-
locales/en.json | 2 +-
locales/es.json | 2 +-
locales/uk.json | 2 +-
.../forms/einwilligungserklaerung.hbs | 2 +-
7 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/controllers/firstLogin.js b/controllers/firstLogin.js
index 5f532f7a96..89e79bb008 100644
--- a/controllers/firstLogin.js
+++ b/controllers/firstLogin.js
@@ -30,7 +30,7 @@ const hasAccount = (req, res) => api(req).get('/consents', {
});
const getSchoolConsentVersionByType = async (req, res, consentType) => {
- if (consentType !== 'privacy' || consentType !== 'termsOfUse') {
+ if (consentType !== 'privacy' && consentType !== 'termsOfUse') {
return undefined;
}
diff --git a/controllers/registration.js b/controllers/registration.js
index 722a58cb1a..2fa0dfdbed 100644
--- a/controllers/registration.js
+++ b/controllers/registration.js
@@ -49,11 +49,11 @@ const checkValidRegistration = async (req) => {
*/
router.get(['/register', '/register/*'], (req, res, next) => res.render('registration/deprecated_warning'));
-const getSchoolPrivacy = async (req, res) => {
+const getSchoolConsentVersionByType = async (req, res, consentType) => {
const importHash = getImportHash(req);
try {
- const consentVersion = await api(req).get(`/registration/consent/${importHash}`);
+ const consentVersion = await api(req).get(`/registration/consent/${importHash}?consentType=${consentType}`);
if (consentVersion) {
const { consentDataId } = consentVersion;
return consentDataId ? `/base64Files/${consentDataId}` : undefined;
@@ -251,8 +251,10 @@ router.get(['/registration/:classOrSchoolId/byparent', '/registration/:classOrSc
hideMenu: true,
user,
needConsent,
- schoolPrivacyLink: await getSchoolPrivacy(req, res),
- schoolPrivacyName: res.$t('global.text.dataProtection'),
+ schoolPrivacyLink: await getSchoolConsentVersionByType(req, res, 'privacy'),
+ schoolTermsLink: await getSchoolConsentVersionByType(req, res, 'termsOfUse'),
+ schoolPrivacyName: res.$t('global.text.dataProtectionFile'),
+ schoolTermsName: res.$t('global.text.termsOfUseFile'),
sectionNumber,
CONSENT_WITHOUT_PARENTS_MIN_AGE_YEARS,
invalid,
@@ -317,8 +319,10 @@ router.get(['/registration/:classOrSchoolId/bystudent', '/registration/:classOrS
user,
needConsent,
sectionNumber,
- schoolPrivacyLink: await getSchoolPrivacy(req, res),
- schoolPrivacyName: res.$t('global.text.dataProtection'),
+ schoolPrivacyLink: await getSchoolConsentVersionByType(req, res, 'privacy'),
+ schoolTermsLink: await getSchoolConsentVersionByType(req, res, 'termsOfUse'),
+ schoolPrivacyName: res.$t('global.text.dataProtectionFile'),
+ schoolTermsName: res.$t('global.text.termsOfUseFile'),
CONSENT_WITHOUT_PARENTS_MIN_AGE_YEARS,
invalid,
secure,
@@ -393,8 +397,10 @@ router.get(['/registration/:classOrSchoolId/:byRole'], async (req, res) => {
user,
needConsent,
sectionNumber,
- schoolPrivacyLink: await getSchoolPrivacy(req, res),
- schoolPrivacyName: res.$t('global.text.dataProtection'),
+ schoolPrivacyLink: await getSchoolConsentVersionByType(req, res, 'privacy'),
+ schoolTermsLink: await getSchoolConsentVersionByType(req, res, 'termsOfUse'),
+ schoolPrivacyName: res.$t('global.text.dataProtectionFile'),
+ schoolTermsName: res.$t('global.text.termsOfUseFile'),
invalid,
secure,
correctID,
@@ -432,8 +438,10 @@ router.get(['/registration/:classOrSchoolId', '/registration/:classOrSchoolId/:s
sso: req.params.sso === 'sso',
account: req.params.accountId || '',
CONSENT_WITHOUT_PARENTS_MIN_AGE_YEARS,
- schoolPrivacyLink: await getSchoolPrivacy(req, res),
- schoolPrivacyName: res.$t('global.text.dataProtection'),
+ schoolPrivacyLink: await getSchoolConsentVersionByType(req, res, 'privacy'),
+ schoolTermsLink: await getSchoolConsentVersionByType(req, res, 'termsOfUse'),
+ schoolPrivacyName: res.$t('global.text.dataProtectionFile'),
+ schoolTermsName: res.$t('global.text.termsOfUseFile'),
invalid,
secure,
correctID,
diff --git a/locales/de.json b/locales/de.json
index ca31789daf..1867dd840c 100644
--- a/locales/de.json
+++ b/locales/de.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "Wenn du zwischen 14 und {{age}} Jahre alt bist, bestätige bitte zusätzlich die Einverständniserklärung, damit du die {{title}} nutzen kannst.",
- "agreeTermsOfUse": "Ich habe die Nutzungsordnung der {{title}} gelesen und stimme ihr zu.",
+ "agreeTermsOfUse": "Ich habe die Nutzungsordnung der {{title}} gelesen und stimme ihr zu.",
"andAuthorisedToRepresent": "und berechtigt, den anderen Elternteil bei den nachfolgenden Erklärungen zu vertreten.",
"iAgreeThatThepersonalData": "Ich erkläre mich damit einverstanden, dass die personenbezogenen Daten meines Kindes entsprechend der",
"invalidLink": "Der Link ist leider nicht mehr gültig. Fordere einen neuen Link von deiner Lehrkraft oder dem Schul-Admin an.",
diff --git a/locales/en.json b/locales/en.json
index 3fb5a5dc45..99e08ee436 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "If you are between 14 and {{age}} years old, please also confirm the declaration of consent so that you can use the {{title}}.",
- "agreeTermsOfUse": "I have read and agree to the Terms of Use of the {{title}}.",
+ "agreeTermsOfUse": "I have read and agree with the school's Terms of Use of the {{title}}.",
"andAuthorisedToRepresent": "and entitled to represent the other parent in the following declarations.",
"iAgreeThatThepersonalData": "I consent to my child's personal data being processed in accordance with the",
"invalidLink": "Unfortunately the link is no longer valid. Request a new link from your teacher or school administrator.",
diff --git a/locales/es.json b/locales/es.json
index 41a5647519..628b9b2f5b 100644
--- a/locales/es.json
+++ b/locales/es.json
@@ -2862,7 +2862,7 @@
},
"text": {
"acceptConsentWithoutParents": "Si tienes entre 14 y {{age}} años, confirma también la declaración de consentimiento para que puedas utilizar {{title}}.",
- "agreeTermsOfUse": "He leído y acepto las Condiciones de uso de {{title}}.",
+ "agreeTermsOfUse": "He leído y acepto las Condiciones de Uso de {{title}}.",
"andAuthorisedToRepresent": "y con derecho a representar al otro padre en las siguientes declaraciones.",
"iAgreeThatThepersonalData": "Doy mi consentimiento para que los datos personales de mi hijo sean procesados de acuerdo con la",
"invalidLink": "Desafortunadamente el enlace ya no es válido. Solicita un nuevo enlace a tu profesor o al administrador de la escuela.",
diff --git a/locales/uk.json b/locales/uk.json
index a0fb5fc54a..a10e01f783 100644
--- a/locales/uk.json
+++ b/locales/uk.json
@@ -2448,7 +2448,7 @@
"unknownError": "Ой, сталася невідома помилка. Спробуйте ще раз.",
"welcomeMailSubject": "Ласкаво просимо до {{title}}!",
"welcomeMailText": "Вітаємо, {{firstName}}!\n Ви можете ввійти до {{title}}, використовуючи такі дані для входу в систему:\n Адреса: {{address}}\n Електронна пошта: {{email}}\n {{password}}\n {{infotext}}\n Ваша\n команда {{shortTitle}} бажає вам веселощів та гарного початку",
- "agreeTermsOfUse": "Я прочитав і погоджуюся з Умовами використання{{title}}.",
+ "agreeTermsOfUse": "Я прочитав і погоджуюся з Умовами використання школи {{title}}.",
"invalidLink": "На жаль, посилання більше не дійсне. Попросіть нове посилання у свого викладача або адміністратора школи.",
"invalidLinkEmbeddedWebsite": "Шкільна хмара була вбудована у веб-сайт. Щоби продовжити ",
"invalidLinkOpenWebsite": "Відкрийте цю сторінку в окремому вікні"
diff --git a/views/registration/forms/einwilligungserklaerung.hbs b/views/registration/forms/einwilligungserklaerung.hbs
index 213df5a899..3e7d16af4b 100644
--- a/views/registration/forms/einwilligungserklaerung.hbs
+++ b/views/registration/forms/einwilligungserklaerung.hbs
@@ -29,7 +29,7 @@