validate the user base data. registration request will also validate user name and password.

@param array $aUserData

@return bool
432998
protected function ValidateUser($aUserData)
    {
        $bValid = false;
        $oActiveUser = self::getExtranetUserProvider()->getActiveUser();
        if ($oActiveUser && is_array($oActiveUser->sqlData) && array_key_exists('customer_number', $oActiveUser->sqlData)) {
            $aUserData['customer_number'] = $oActiveUser->sqlData['customer_number'];
        }
        $oUser = TdbDataExtranetUser::GetNewInstance($aUserData);

        $bValid = $oUser->ValidateData();

        if ('register' == TShopStepUserDataV2::GetUserMode()) {
            $bValid = ($oUser->ValidateLoginData($aUserData) && $bValid);
        } elseif ('guest' == TShopStepUserDataV2::GetUserMode()) {
            if (TdbDataExtranet::GetInstance()->fieldLoginIsEmail) {
                $bValid = ($this->validateUserEMail($aUserData['name']) && $bValid);
            } else {
                $bValid = ($this->validateUserEMail($aUserData['email']) && $bValid);
            }
        }

        return $bValid;
    }
1152954
public function is_valid(array $data) {

		$this->data = $this->apply_filters($data);

		$this->errors = $this->test_rules();

		return empty($this->errors);

	}
952687
protected function InitUserData()
    {
        $userData = $this->getInputFilterUtil()->getFilteredPostInput('aUser');
        if (null === $userData) {
            $oUser = self::getExtranetUserProvider()->getActiveUser();
            $this->SetUserData($oUser->sqlData);
        } else {
            $this->SetUserData($userData);
            $this->bUserDataSubmission = true;
        }
    }
226723
public function verify(array $data)
    {
        if (is_callable($this->callback)) {
            return call_user_func($this->callback, $data);
        }

        return false;
    }
737538
public final function validate(array $data = null, array $rules = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if (empty($data)) {
			throw new ValidateException(['error' => 'data is empty']);
		}
		if ($rules) {
			$this->rules    = [];
			$this->rulesIdx = [];
			$this->ruleKeys = [];
			foreach ($rules as $field => $rule) {
				$this->addRule($field, $rule);
			}
		}

		return $this->validateNewData($data);
	}
1258273
function validation($data, $files) {
        global $USER;
        $errors = parent::validation($data, $files);
        $reason = null;

        // ignore submitted username
        if (!$user = authenticate_user_login($USER->username, $data['password'], true, $reason, false)) {
            $errors['password'] = get_string('invalidlogin');
            return $errors;
        }

        if ($data['newpassword1'] <> $data['newpassword2']) {
            $errors['newpassword1'] = get_string('passwordsdiffer');
            $errors['newpassword2'] = get_string('passwordsdiffer');
            return $errors;
        }

        if ($data['password'] == $data['newpassword1']){
            $errors['newpassword1'] = get_string('mustchangepassword');
            $errors['newpassword2'] = get_string('mustchangepassword');
            return $errors;
        }

        if (user_is_previously_used_password($USER->id, $data['newpassword1'])) {
            $errors['newpassword1'] = get_string('errorpasswordreused', 'core_auth');
            $errors['newpassword2'] = get_string('errorpasswordreused', 'core_auth');
        }

        $errmsg = '';//prevents eclipse warnings
        if (!check_password_policy($data['newpassword1'], $errmsg)) {
            $errors['newpassword1'] = $errmsg;
            $errors['newpassword2'] = $errmsg;
            return $errors;
        }

        return $errors;
    }
937875
private function validateAttributes(array $jsonData): self
    {
        // execute start(s)
        $this->executeStarts($this->getSerializer()::readRulesStartIndexes($this->getAttributeRules()));

        if (array_key_exists(DI::KEYWORD_DATA, $jsonData) === true &&
            array_key_exists(DI::KEYWORD_ATTRIBUTES, $data = $jsonData[DI::KEYWORD_DATA]) === true
        ) {
            if (is_array($attributes = $data[DI::KEYWORD_ATTRIBUTES]) === false) {
                $title   = $this->formatMessage(Messages::INVALID_VALUE);
                $details = $this->formatMessage(Messages::INVALID_ATTRIBUTES);
                $status  = JsonApiResponse::HTTP_UNPROCESSABLE_ENTITY;
                $this->getJsonApiErrorCollection()->addAttributesError($title, $details, (string)$status);
                $this->addErrorStatus($status);
            } else {
                // execute main validation block(s)
                foreach ($attributes as $name => $value) {
                    if (($index = $this->getAttributeIndex($name)) !== null) {
                        $this->executeBlock($value, $index);
                    } elseif ($this->isIgnoreUnknowns() === false) {
                        $title   = $this->formatMessage(Messages::INVALID_VALUE);
                        $details = $this->formatMessage(Messages::UNKNOWN_ATTRIBUTE);
                        $status  = JsonApiResponse::HTTP_UNPROCESSABLE_ENTITY;
                        $this->getJsonApiErrorCollection()
                            ->addDataAttributeError($name, $title, $details, (string)$status);
                        $this->addErrorStatus($status);
                    }
                }
            }
        }

        // execute end(s)
        $this->executeEnds($this->getSerializer()::readRulesEndIndexes($this->getAttributeRules()));

        if (count($this->getErrorAggregator()) > 0) {
            $status  = JsonApiResponse::HTTP_UNPROCESSABLE_ENTITY;
            foreach ($this->getErrorAggregator()->get() as $error) {
                $this->getJsonApiErrorCollection()->addValidationAttributeError($error, $status);
            }
            $this->addErrorStatus($status);
            $this->getErrorAggregator()->clear();
        }

        return $this;
    }
202042
private function validateInput( $settings ) {
        if ( !isset( $settings["serverUrl"] ) ||
             !isset( $settings["username"] ) ||
             !isset( $settings["password"] )
        ) {
            throw new \InvalidArgumentException( 'Username, password or serverUrl is incorrect' );
        }

        if ( !filter_var( $settings["serverUrl"], FILTER_VALIDATE_URL )
             || strpos( $settings["serverUrl"], "." ) === false
        ) {
            throw new \InvalidArgumentException( 'Invalid serverUrl has been provided' );
        }

        if ( !in_array( $settings['authMode'], [ 'OnlineFederation', 'Federation' ] ) ) {
            throw new \InvalidArgumentException( 'Provided authentication mode <' . $this->authMode . '> is not supported' );
        }
    }
813164
public function loginUser(array $userData)
    {
        // Login has failed with this email/password.
        if (! auth()->attempt($userData, request('remember', false))) {
            return $this->handleInvalidCredentials();
        }

        // Check if the user is inactive.
        if (auth()->user()->status_id === Status::INACTIVE) {
            return $this->handleInactiveUser();
        }

        // Check if the user has been blocked.
        if (auth()->user()->status_id === Status::BLOCKED) {
            return $this->handleBlockedUsers();
        }

        // User has passed all checks and can be redirected to the site.
        return $this->handleSuccessfulLogin();
    }
1066418
public function validate($data) {

        if (get_config('auth_ldap', 'ntlmsso_type') === 'ntlm') {
            $format = trim($data);
            if (!empty($format) && !preg_match('/%username%/i', $format)) {
                return get_string('auth_ntlmsso_missing_username', 'auth_ldap');
            }
        }

        return parent::validate($data);
    }
938519
public function validate($attributes=[], $returnData=false)
    {
        // Data fetched by ORM or input
        $data = ($attributes) ? $attributes : $this->_writeProperties;
        // Filter first
        $data = $this->filter($data);
        // ORM re-assign properties
        $this->_writeProperties = (!$attributes) ? $data : $this->_writeProperties;
        // Get validation rules from function setting
        $rules = $this->rules();

        // The ORM update will only collect rules with corresponding modified attributes.
        if ($this->_selfCondition) {

            $newRules = [];
            foreach ((array) $rules as $key => $rule) {
                if (isset($this->_writeProperties[$rule['field']])) {
                    // Add into new rules for updating
                    $newRules[] = $rule;
                }
            }
            // Replace with mapping rules
            $rules = $newRules;
        }

        // Check if has rules
        if (empty($rules))
            return ($returnData) ? $data : true;

        // CodeIgniter form_validation doesn't work with empty array data
        if (empty($data))
            return false;

        // Load CodeIgniter form_validation library for yidas/model namespace, which has no effect on common one
        get_instance()->load->library('form_validation', null, 'yidas_model_form_validation');
        // Get CodeIgniter validator
        $validator = get_instance()->yidas_model_form_validation;
        $validator->reset_validation();
        $validator->set_data($data);
        $validator->set_rules($rules);
        // Run Validate
        $result = $validator->run();
        
        // Result handle
        if ($result===false) {

            $this->_errors = $validator->error_array();
            return false;

        } else {

            return ($returnData) ? $data : true;
        }
    }
266849
public static function filterInputDataIsArray($inputData = [], $requireData = [])
    {
        if (empty($inputData) || empty($requireData)) {
            return FALSE;
        }
        if (count($requireData) <= 0 || count($inputData) <= 0) {
            return FALSE;
        }
        if (!is_array($requireData) || !is_array($inputData)) {
            return FALSE;
        }
        foreach ($requireData as $params) {
            if (!array_key_exists($params, $inputData)) {
                return FALSE;
            }
        }

        return TRUE;
    }
216935
public static function validate($data)
    {
        if (count(array_intersect_key(array_flip(static::$requiredParams), $data)) === count(static::$requiredParams)) {
            return true;
        }

        throw new InvalidArgumentException();
    }
645880
public function update(array $data)
    {
        try
        {
            if ( $this->validator->with($data)->validForUpdate() )
            {
                $this->users->update($data['id'], $this->validator->getData());
                return true;
            }
        }
        catch (LoginRequiredException $e)
        {
            $this->validator->add('LoginRequiredException',$e->getMessage());
        }
        catch (PasswordRequiredException $e)
        {
            $this->validator->add('PasswordRequiredException',$e->getMessage());
        }
        catch (UserExistsException $e)
        {
            $this->validator->add('UserExistsException',$e->getMessage());
        }

        return false;
    }
767898
public function check_data($formdata) {
        $profilefields = $this->get_profile_fields();

        if (empty($profilefields)) {
            return false;
        }

        $field    = $this->_name;
        $operator = $field.'_op';
        $profile  = $field.'_fld';

        if (array_key_exists($profile, $formdata)) {
            if ($formdata->$operator < 5 and $formdata->$field === '') {
                return false;
            }

            return array('value'    => (string)$formdata->$field,
                         'operator' => (int)$formdata->$operator,
                         'profile'  => (int)$formdata->$profile);
        }
    }
470632
public function validate(array $toValidate = [])
    {
        $return = true;
        $validators = $this->getValidatorsForFields($toValidate);
        foreach ($validators as $validator) {
            $res = $validator->validate($toValidate);
            if ($res === false && $return === true) {
                $return = false;
            }
        }
        $elements = $this->getElements();
        foreach ($elements as $el) {
            if (
                (!empty($toValidate) && !in_array($el->getName(), $toValidate))
                || !($el instanceof \marvin255\serviform\interfaces\HasValidators)
            ) {
                continue;
            }
            $res = $el->validate();
            if ($res === false && $return === true) {
                $return = false;
            }
        }

        return $return;
    }
992886
protected final function validateUpdateData(array $data = null) {
		if ($data === null && isset($this->_formData)) {
			$data = $this->_formData;
		}
		if ($this->rules) {
			$newRules = [];
			foreach ($data as $key => $v) {
				if (isset($this->rules[ $key ])) {
					$newRules[ $key ] = $this->rules[ $key ];
				}
			}
			if ($newRules) {
				return $this->validateData($newRules, $data);
			}
		}

		return true;
	}