/** * Creates a form model given a token. * * @param string $token * @param array $config * @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('Токен подтверждения e-mail не может быть пустым.'); } $this->_user = User::findByEmailConfirmToken($token); if (!$this->_user) { throw new InvalidParamException('Неверный токен подтверждения e-mail.'); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config * @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('Email confirm token cannot be blank.'); } $this->_user = User::findByEmailConfirmToken($token); if (!$this->_user) { throw new InvalidParamException('Wrong Email confirm token.'); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config * @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', 'No confirm code')); } $this->_user = User::findByEmailConfirmToken($token); if (!$this->_user) { throw new InvalidParamException(Yii::t('app', 'Invalid token')); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config * @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::findByEmailConfirmToken($token); if (!$this->_user) { throw new InvalidParamException('Неверный токен.'); } parent::__construct($config); }
/** * Creates a form model given a token. * * @param string $token * @param array $config * @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(Module::t('app', 'EMAIL_CONFIRM_CONSTRUCT_BLANK_OR_STRING_TOKEN')); } $this->_user = User::findByEmailConfirmToken($token); if (!$this->_user) { throw new InvalidParamException(Module::t('app', 'EMAIL_CONFIRM_CONSTRUCT_WRONG_TOKEN')); } parent::__construct($config); }