From eda30f236e9518105218b18f68717d5fd819062c Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 27 May 2018 01:32:03 +0200 Subject: [PATCH] Added GDPR rules --- src/User/Form/RegistrationForm.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/User/Form/RegistrationForm.php b/src/User/Form/RegistrationForm.php index ed2caaa..d0f9bc7 100644 --- a/src/User/Form/RegistrationForm.php +++ b/src/User/Form/RegistrationForm.php @@ -73,9 +73,14 @@ class RegistrationForm extends Model // password rules 'passwordRequired' => ['password', 'required', 'skipOnEmpty' => $this->module->generatePasswords], 'passwordLength' => ['password', 'string', 'min' => 6, 'max' => 72], - 'gdprConsent' => ['gdpr_consent', 'required', 'when' => function () { - return $this->module->enableGPDRcompliance; - }] + 'gdprType' => ['gdpr_consent', 'boolean'], + 'gdprRequired' => ['gdpr_consent', + 'compare', + 'compareValue' => true, + 'message' => Yii::t('xenon','Your consent is required to register'), + 'when' => function () { + return $this->module->enableGDPRcompliance; + }] ]; }