Finds out if unencrypted password fulfill requirements.
@param string $attribute
420782
public function passwordRequirements($attribute)
    {
        if (!preg_match('~\p{Lu}~', $this->$attribute) ||
            !preg_match('~\p{Ll}~', $this->$attribute) ||
            !preg_match('~[0-9]~', $this->$attribute) ||
            mb_strlen($this->$attribute, 'UTF-8') < 6 ||
            mb_strlen($this->$attribute, 'UTF-8') > 100) {
            $this->addError($attribute, Yii::t('podium/view', 'Password must contain uppercase and lowercase letter, digit, and be at least 6 characters long.'));
        }
    }
904783
protected function validateAttribute($object, $attribute)
    {
        $value = $object->{$attribute};
        if ($this->isEmpty($value)) {
            $this->addError($object, $attribute, $this->message);
        }
    }
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.'));
            }
        }
    }
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.'));
                }
            }
        }
    }
1337419
protected function checkAttributeAssignable($attribute): void
    {
        if (empty($this->assignable)) {
            return;
        }

        if (is_array($attribute)) {

            foreach ($attribute as $singleAttribute) {
                $this->checkAttributeAssignable($singleAttribute);
            }

            return;
        }

        if ( ! in_array($attribute, $this->assignable)) {
            throw new UnassignableAttributeException("Not allowed to assign value for '{$attribute}'");
        }
    }
57016
protected function _decodeAttribute(&$data, $attribute)
    {
        /* Data. */
        $value = $this->_getx($data, $this->_geti($data, 32));

        /* Checksum. */
        $this->_geti($data, 16);

        return $value;
    }
1102596
public function setHashingAttribute($attribute, $value)
    {
        // Set the value which is presumably plain text
        $this->attributes[$attribute] = $value;

        // Do the hashing if it needs it
        if ( ! empty($value) && ($this->isDirty($attribute) || ! $this->isHashed($attribute))) {
            $this->attributes[$attribute] = $this->hash($value);
        }
    }
281982
public function has($attribute, $value = null)
    {
        if (!array_key_exists(strtolower($attribute), array_change_key_case($this->attributes))) {
            return false;
        }

        return is_null($value) ?: $this->attributeHasValue($attribute, $value);
    }
479016
protected function doEncryptAttribute($key)
    {
        if ($this->shouldEncrypt($key) && ! $this->isEncrypted($this->attributes[$key])) {
            try {
                $this->attributes[$key] = $this->encryptedAttribute($this->attributes[$key]);
            } catch (EncryptException $e) {
            }
        }
    }
995817
public function validatePassword($attribute, $params)
    {
      if ($this->user === null || !Password::validate($this->password, $this->user->password_hash))
        $this->addError($attribute, Yii::t('user', 'Invalid login or password'));
    }
230807
public function passwordHasNotExpired($attribute, $params)
    {
        if (($behavior = $this->getBehavior('expiredPasswordBehavior')) !== null) {
            return $behavior->passwordHasNotExpired($attribute, $params);
        }

        return true;
    }
1256780
protected function validateTagAttribute(string $attribute) : bool
    {
        if (!empty($this->attributePattern)) {
            $matches = [];
            return preg_match($this->attributePattern, $attribute, $matches);
        } else {
            return empty($attribute);
        }
    }
1212438
public function setPasswordAttribute($password)
    {
        if (!empty($password)) {
            $password = bcrypt($password);
            JWTUtilities::invalidateTokenByUserId($this->id);
            // When password is set user account must be confirmed. Confirming user
            // account here with confirm_code = null.
            // confirm_code = 'y' indicates cases where account is confirmed by user
            // using confirmation email.
            if (isset($this->attributes['confirm_code']) && $this->attributes['confirm_code'] !== 'y') {
                $this->attributes['confirm_code'] = null;
            }
        }

        $this->attributes['password'] = $password;
    }
1080679
public function passes($attribute, $value)
    {
        $value = strtolower($value);

        foreach ($this->words as $word) {
            if (stripos($value, $word) !== false) {
                $this->detectedWord = $word;

                return false;
            }
        }

        return true;
    }
462108
protected function validateNumeric( $attribute, $value )
	{
		if ( !$this->hasAttribute( $attribute ) )
		{
			return true;
		}

		return is_null( $value ) || is_numeric( $value );
	}
332428
public function setEncryptingAttribute($attribute, $value)
    {
        array_set($this->attributes, $attribute, $this->encrypt($value));
    }
384423
public function validateSectionWhitelist(string $attribute) {

		$sections = $this->getSections();

		foreach ($this->whitelistedSections as $section) {
			if (!isset($sections[$section])) {
				$this->addError($attribute, Craft::t('section-field', 'Invalid section selected.'));
			}
		}
	}