Added gdpr hint and static field

This commit is contained in:
Administrator
2018-05-27 00:50:41 +02:00
parent 14b6c6af7d
commit 80412f5807
2 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ use Da\User\Traits\ContainerAwareTrait;
use Da\User\Traits\ModuleAwareTrait;
use Yii;
use yii\base\Model;
use yii\helpers\Html;
class RegistrationForm extends Model
{
@ -34,6 +35,10 @@ class RegistrationForm extends Model
* @var string Password
*/
public $password;
/**
* @var bool Data processing consent
*/
public $gdpr_consent;
/**
* {@inheritdoc}
@ -83,6 +88,21 @@ class RegistrationForm extends Model
'email' => Yii::t('usuario', 'Email'),
'username' => Yii::t('usuario', 'Username'),
'password' => Yii::t('usuario', 'Password'),
'gdpr_consent' => Yii::t('usuario', 'Data processing consent')
];
}
public function attributeHints()
{
return [
'gdpr_consent' => Yii::t('usuario', 'I aggree processing of my personal data and the use of cookies
to facilitate the operation of this site. For more information read our {privacyPolicy}',
[
'privacyPolicy' => Html::a(Yii::t('usuario', 'privacy policy'),
$this->module->GDPRprivacyPolicyUrl,
['target' => '_blank']
)
])
];
}
}

View File

@ -45,6 +45,10 @@ $this->params['breadcrumbs'][] = $this->title;
<?= $form->field($model, 'password')->passwordInput() ?>
<?php endif ?>
<?php if ($module->enableGPDRcompliance == false): ?>
<?= $form->field($model, 'gdpr_consent')->checkbox() ?>
<?php endif ?>
<?= Html::submitButton(Yii::t('usuario', 'Sign up'), ['class' => 'btn btn-success btn-block']) ?>
<?php ActiveForm::end(); ?>