Validates mobile to ensure that only one user exist with the given mobile.

@param type $attribute
@param type $params
@return void
963935
public function validateMobileCreate( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			if( self::isExistByMobile( $this->mobile ) ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_MOBILE_EXIST ) );
			}
		}
	}
605523
public function validateUsernameCreate( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			if( self::isExistByUsername( $this->username ) ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_USERNAME_EXIST ) );
			}
		}
	}
780821
public function normalizeTags($attribute, $params)
    {
        $this->tags = Tag::array2String(array_unique(Tag::string2Array($this->tags)));
    }
1246401
public function validatePassword($attribute, $params)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            if ($user && $user->status === UserStatus::DELETED) {
                $this->addError($attribute, Yii::t('yii2mod.user', 'Your account has been deactivated, please contact support for details.'));
            } elseif (!$user || !$user->validatePassword($this->password)) {
                $this->addError($attribute, Yii::t('yii2mod.user', 'Incorrect email or password.'));
            }
        }
    }
60434
public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        $result = $this->validateValue($value);

        if (!empty($result)) {
            $this->addError($model, $attribute, $this->renderMessage($model, $attribute));
        }
    }
690952
public function validatePassword($attribute, $params)
    {
        if (!$this->hasErrors()) {
            $user = $this->getUser();
            if (!$user || !$user->validatePassword($this->password)) {
                $this->addError($attribute, Yii::t($this->tcModule, 'Incorrect username or password.'));
            }
        }
    }
445081
public function validatePassword( $attribute, $params ) {

		if( !$this->hasErrors() ) {

			$user = $this->getUser();

			if( $user && !$user->validatePassword( $this->password ) ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_LOGIN_FAILED ) );
			}
		}
	}
481044
public function validateAttribute($model, $attribute)
    {
        if (
            $this->targetClass !== null
            && $model->$attribute instanceof $this->targetClass
            && !empty($model->$attribute->isNewRecord)
        ) {
            return;
        }

        if ($model->isRelationPopulated($attribute)) {
            return;
        }

        parent::validateAttribute($model, $attribute);
    }
1224914
public function validateIdentity($attributes, $params)
    {
        // Search the database for a user with that information
        $metadata = UserMetadata::model()->findByAttributes(array(
            'key' => $this->provider.'Provider',
            'value' => $this->adapter->identifier
        ));

        // Return an error if we didn't find them
        if ($metadata == NULL)
        {
            $this->addError('adapter', Yii::t('HybridAuth.main', 'Unable to determine local user for identity'));
            return false;
        }

        // Otherwise load that user
        $this->_user = Users::model()->findByPk($metadata->user_id);
        if ($this->_user == NULL)
        {
            $this->addError('adapter', Yii::t('HybridAuth.main', 'Unable to determine local user for identity'));
            return false;
        }

        // And return true
        return true;
    }
956251
public function validatePassword($attribute)
    {
        if (!$this->hasErrors()) {
            $user = $this->user;
            if (empty($user) || !$user->validatePassword($this->password)) {
                $this->addError($attribute, 'Incorrect username or password.');
            }
        }
    }
1254106
public function checkPasswordNotUsed($attribute, $params, $validator)
    {
        $class = $this->passwordHistoryClass;
        $result = $class::isUsed($this->_password, $this);
        if ($result != false) {
            $this->trigger(static::$eventPasswordUsed);
            $this->addError($attribute, $this->passwordUsedMessage);
        }
    }
388667
public function validateUser( $attribute, $params ) {

        if( !$this->hasErrors() ) {

			$user = $this->user;

            if( !isset( $user ) ) {

				$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_USER_NOT_EXIST ) );
            }
			else {

				if( !$this->hasErrors() && !$user->isVerified( false ) ) {

					$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_USER_VERIFICATION ) );
				}

				if( !$this->hasErrors() && $user->isBlocked() ) {

					$this->addError( $attribute, Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_BLOCKED ) );
				}
			}
        }
    }
797375
public function validateUrl($attribute, $params)
    {
        $parentParentId = (null === $this->structure) ? 0 : (int)$this->structure->parent_id;
        $parentContextId = (null === $this->structure) ? 0 : (int)$this->structure->context_id;
        if (
            $this->slug != $this->oldSlug
            || $this->parentParentId !== $parentParentId
            || $this->parentContextId !== $parentContextId
        ) {
            $url = $this->compileUrl();
            $query = self::find()
                ->select('url')
                ->innerJoin(
                    BaseStructure::tableName(),
                    'model_id = ' . BaseStructure::tableName() . '.id'
                )
                ->where([
                    'language_id' => $this->language_id,
                    'context_id' => $this->parentContextId,
                    'url' => $url
                ]);
            if (false === $this->isNewRecord) {
                $query->andWhere(['not', ['model_id' => $this->model_id]]);
            }
            $isset = $query->scalar();
            if (false !== $isset) {
                $this->addError('slug', Yii::t(
                    'dotplant.entity.structure',
                    'Value \'{value}\' already in use, please, choose another!',
                    ['value' => $this->slug]
                ));
            }
            $this->url = $url;
        }
    }
821615
public function confirmationValidate($attribute)
    {
        if (!$this->hasErrors()) {
            if ($this->user !== null) {
                $confirmationRequired = Yii::$app->settings->get('enableConfirmation', 'user') && !Yii::$app->settings->get('enableUnconfirmedLogin', 'user');
                if ($confirmationRequired && !$this->user->isEmailConfirmed) {
                    $this->addError($attribute, Yii::t('yuncms', 'You need to confirm your email address.'));
                }
                if ($this->user->isBlocked) {
                    $this->addError($attribute, Yii::t('yuncms', 'Your account has been blocked.'));
                }
            }
        }
    }
714576
public function validateAttribute($model, $attribute)
    {
        $value = $model->$attribute;
        $captcha = $this->createCaptchaAction($model);
        $valid = !is_array($value) && $captcha->validate($value);
        $isExpired = $captcha->isExpired();

        $result = $isExpired ? [$this->getMessageForExpiredCaptcha(), []] : ($valid ? null : [$this->message, []]);
//        $result = $this->validateValue($model->$attribute, $model);
        if (!empty($result)) {
            $this->addError($model, $attribute, $result[0], $result[1]);
        }
    }
776316
protected function validateEmpty($object, $attribute)
    {
        if (!$this->allowEmpty) {
            $this->addError($object, $attribute, $this->emptyMessage);
        }
    }
1125217
public function validatePassword($attribute)
    {
        if (!$this->hasErrors()) {
            if ($this->user === null || !PasswordHelper::validate($this->password, $this->user->password_hash)) {
                $this->addError($attribute, Yii::t('yuncms', 'Invalid login or password'));
            }
        }
    }