From d3223142799d399b5988cd0013f82fc84b89ee3a Mon Sep 17 00:00:00 2001 From: "E.Alamo" Date: Sun, 27 May 2018 03:54:28 +0200 Subject: [PATCH] Add gdprDelete form model --- src/User/Form/GdprDeleteForm.php | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/User/Form/GdprDeleteForm.php diff --git a/src/User/Form/GdprDeleteForm.php b/src/User/Form/GdprDeleteForm.php new file mode 100644 index 0000000..2cd023d --- /dev/null +++ b/src/User/Form/GdprDeleteForm.php @@ -0,0 +1,57 @@ +securityHelper = $securityHelper; + parent::__construct($config); + } + + /** + * {@inheritdoc} + */ + public function rules() + { + return [ + 'requiredFields' => [['password'], 'required'], + 'passwordValidate' => [ + 'password', + function ($attribute) { + if ($this->user === null || + !$this->securityHelper->validatePassword($this->password, $this->user->password_hash) + ) { + $this->addError($attribute, Yii::t('usuario', 'Invalid login or password')); + } + }, + ] + ]; + } + +} \ No newline at end of file