Переименован класс валидатора пароля

This commit is contained in:
ErickSkrauch 2016-11-01 23:59:43 +03:00
parent 91df81f97d
commit 3cce2c9bd1
4 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ use api\models\AccountIdentity;
use api\models\base\KeyConfirmationForm; use api\models\base\KeyConfirmationForm;
use common\helpers\Error as E; use common\helpers\Error as E;
use common\models\EmailActivation; use common\models\EmailActivation;
use common\validators\PasswordValidate; use common\validators\PasswordValidator;
use Yii; use Yii;
use yii\base\ErrorException; use yii\base\ErrorException;
@ -19,7 +19,7 @@ class RecoverPasswordForm extends KeyConfirmationForm {
return array_merge(parent::rules(), [ return array_merge(parent::rules(), [
['newPassword', 'required', 'message' => E::NEW_PASSWORD_REQUIRED], ['newPassword', 'required', 'message' => E::NEW_PASSWORD_REQUIRED],
['newRePassword', 'required', 'message' => E::NEW_RE_PASSWORD_REQUIRED], ['newRePassword', 'required', 'message' => E::NEW_RE_PASSWORD_REQUIRED],
['newPassword', PasswordValidate::class], ['newPassword', PasswordValidator::class],
['newRePassword', 'validatePasswordAndRePasswordMatch'], ['newRePassword', 'validatePasswordAndRePasswordMatch'],
]); ]);
} }

View File

@ -11,7 +11,7 @@ use common\models\EmailActivation;
use common\models\UsernameHistory; use common\models\UsernameHistory;
use common\validators\EmailValidator; use common\validators\EmailValidator;
use common\validators\LanguageValidator; use common\validators\LanguageValidator;
use common\validators\PasswordValidate; use common\validators\PasswordValidator;
use common\validators\UsernameValidator; use common\validators\UsernameValidator;
use Exception; use Exception;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
@ -47,7 +47,7 @@ class RegistrationForm extends ApiForm {
['password', 'required', 'message' => E::PASSWORD_REQUIRED], ['password', 'required', 'message' => E::PASSWORD_REQUIRED],
['rePassword', 'required', 'message' => E::RE_PASSWORD_REQUIRED], ['rePassword', 'required', 'message' => E::RE_PASSWORD_REQUIRED],
['password', PasswordValidate::class], ['password', PasswordValidator::class],
['rePassword', 'validatePasswordAndRePasswordMatch'], ['rePassword', 'validatePasswordAndRePasswordMatch'],
['lang', LanguageValidator::class], ['lang', LanguageValidator::class],

View File

@ -5,7 +5,7 @@ use api\models\base\ApiForm;
use api\validators\PasswordRequiredValidator; use api\validators\PasswordRequiredValidator;
use common\helpers\Error as E; use common\helpers\Error as E;
use common\models\Account; use common\models\Account;
use common\validators\PasswordValidate; use common\validators\PasswordValidator;
use Yii; use Yii;
use yii\base\ErrorException; use yii\base\ErrorException;
use yii\helpers\ArrayHelper; use yii\helpers\ArrayHelper;
@ -37,7 +37,7 @@ class ChangePasswordForm extends ApiForm {
return ArrayHelper::merge(parent::rules(), [ return ArrayHelper::merge(parent::rules(), [
['newPassword', 'required', 'message' => E::NEW_PASSWORD_REQUIRED], ['newPassword', 'required', 'message' => E::NEW_PASSWORD_REQUIRED],
['newRePassword', 'required', 'message' => E::NEW_RE_PASSWORD_REQUIRED], ['newRePassword', 'required', 'message' => E::NEW_RE_PASSWORD_REQUIRED],
['newPassword', PasswordValidate::class], ['newPassword', PasswordValidator::class],
['newRePassword', 'validatePasswordAndRePasswordMatch'], ['newRePassword', 'validatePasswordAndRePasswordMatch'],
['logoutAll', 'boolean'], ['logoutAll', 'boolean'],
['password', PasswordRequiredValidator::class, 'account' => $this->_account], ['password', PasswordRequiredValidator::class, 'account' => $this->_account],

View File

@ -7,7 +7,7 @@ use yii\validators\StringValidator;
/** /**
* Класс должен реализовывать в себе все критерии валидации пароля пользователя * Класс должен реализовывать в себе все критерии валидации пароля пользователя
*/ */
class PasswordValidate extends StringValidator { class PasswordValidator extends StringValidator {
public $min = 8; public $min = 8;