/** * Creates a form model given a token. * * @param string $token * @param array $config name-value pairs that will be used to initialize the object properties * @throws \yii\base\InvalidParamException if token is empty or not valid */ public function __construct($token, $config = []) { if (empty($token) || !is_string($token)) { throw new InvalidParamException('Пароль не может быть сброшен на пустой.'); } $this->_user = User::findByPasswordResetToken($token); if (!$this->_user) { throw new InvalidParamException('Wrong password reset token.'); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config name-value pairs that will be used to initialize the object properties * @throws \yii\base\InvalidParamException if token is empty or not valid */ public function __construct($token, $config = []) { if (empty($token) || !is_string($token)) { throw new InvalidParamException(Yii::t('app', 'Password reset token cannot be blank.')); } $this->_user = User::findByPasswordResetToken($token); if (!$this->_user) { throw new InvalidParamException(Yii::t('app', 'Wrong password reset token.')); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config name-value pairs that will be used to initialize the object properties * @throws \yii\base\InvalidParamException if token is empty or not valid */ public function __construct($token, $config = []) { if (empty($token) || !is_string($token)) { throw new InvalidParamException('Маркер восстановление пароля не может быть пустым.'); } $this->_user = User::findByPasswordResetToken($token); if (!$this->_user) { throw new InvalidParamException('Не верный маркер для сброса пароля.'); } parent::__construct($config); }