예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 public function __construct($token, $config = [])
 {
     if (empty($token) || !is_string($token)) {
         throw new InvalidParamException('Ошибочная ссылка подтверждения email.');
     }
     $this->_user = User::findByEmailConfirmToken($token);
     if (!$this->_user) {
         throw new InvalidParamException('Ошибочная ссылка подтверждения email.');
     }
     parent::__construct($config);
 }
예제 #3
0
 /**
  * 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);
 }