Validates form and logs the user in.

@return boolean whether the user is logged in successfully
976102
public function login()
    {
        if ($this->validate()) {
            UserLoginHistory::createAsync(['user_id' => $this->user->getId(), 'ip' => Yii::$app->request->userIP]);
            return Yii::$app->user->login($this->user, $this->rememberMe ? Yii::$app->settings->get('rememberFor', 'user') : 0);
        } else {
            return false;
        }
    }
1080855
public function isLoggedIn() : bool {

		// Requires a started session
		if (isset($_SESSION["login_token"])) {
			$loginToken = $_SESSION["login_token"];
			return $this->sessionManager->isValidLoginToken($loginToken);
		} else {
			return false;
		}
	}
92541
public function isLoggedIn()
    {
        $isSimulatedLoggedIn = ($this->loggedInUser !== null);
        $isReallyLoggedIn = $this->getFrontEndController() !== null && $this->getFrontEndController()->loginUser;

        return $isSimulatedLoggedIn || $isReallyLoggedIn;
    }
243821
public function validateInput()
	{
		$v = Validator::make ( $this->model->getFormInput() , $this->model->getRules() );

		$success = true;
		if ( $v->fails() )
		{
			$this->model->setErrors( $v->messages() );
			$success = false;
		}

		return $success;
	}
1076582
public function isLoggedIn() {
		return isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_LOGGED_IN]) && $_SESSION[self::SESSION_FIELD_LOGGED_IN] === true;
	}
129772
public function doValidate()
    {
        $isValid = true;
        if ($this->props['validate']) {
            $isValid = \call_user_func($this->props['validate'], $this);
        }
        return $isValid;
    }
910133
public function validLoggedInAdmin()
    {
        $loggedInUser = $this->getCurrentLoggedInUser();
        if ($loggedInUser
            && $loggedInUser->administrator
            && $loggedInUser->deleted === null
            && $loggedInUser->enabled) {
                return true;
        }
        return false;
    }
1245475
public function isLogined()
    {
        $session = $this->getSession();
        $cookie = $this->getCookie();

        if ($cookie->has(self::USER_SESSION)) {
            $login = $cookie->get(self::USER_SESSION);
            $login = unserialize(base64_decode($login));
        }elseif (false !== $session->has(self::USER_SESSION)) {
            $login = $session->get(self::USER_SESSION);
        }else{
            return false;
        }

        return $this->isSameIp($login);
    }
922577
public function isLogged()
    {
        $user = $this->session->get('user');
        if (isset($user['logged_' . $this->table])
            && $user['logged_' . $this->table] === true
        ) {
            return true;
        }
        return false;
    }
341624
protected function validateUserIdAddress()
    {
        $field = 'user_id';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('User');

        if (empty($value) || mb_strlen($value) > 255) {
            $this->setErrorLengthRange($field, $label);
            return false;
        }

        if (!is_numeric($value)) {
            return true; // Anonymous user
        }

        $user = $this->user->get($value);

        if (empty($user)) {
            $this->setErrorUnavailable($field, $label);
            return false;
        }

        return true;
    }
227876
function validate() {

		// Is this an ODT?
		if ( ! $this->isOdt( $this->outputPath ) ) {

			$this->logError( \Pressbooks\Utility\get_contents( $this->logfile ) );

			return false;
		}

		return true;
	}
335134
final public function validate(): bool
    {
        // validate csrf token if required
        if ($this->_tokenRequired && !$this->_tokenOk) {
            App::$Session->getFlashBag()->add('warning', __('Hack attention: security token is wrong!'));
            return false;
        }
        // get all rules as array from method rules()
        $rules = $this->rules();
        // get default values of attributes
        $defaultAttr = $this->getAllProperties();

        // start validation: on this step class attribute values will be changed to input data if it valid
        $success = $this->runValidate($rules);

        // get not-passed validation fields as array
        $badAttributes = $this->getBadAttributes();
        // prevent warnings
        if (Any::isArray($badAttributes) && count($badAttributes) > 0) {
            foreach ($badAttributes as $attr) {
                if (Str::contains('.', $attr)) { // sounds like dot-separated array attr
                    $attrName = strstr($attr, '.', true); // get attr name
                    $attrArray = trim(strstr($attr, '.'), '.'); // get dot-based array path

                    $defaultValue = new DotData($defaultAttr); // load default attr

                    $dotData = new DotData($this->{$attrName}); // load local attr variable
                    $dotData->set($attrArray, $defaultValue->get($attr)); // set to local prop. variable default value

                    $this->{$attrName} = $dotData->export(); // export to model
                } else {
                    $this->{$attr} = $defaultAttr[$attr]; // just set ;)
                }
                // add message about wrong attribute to session holder, later display it
                $attrLabel = $attr;
                if ($this->getLabel($attr) !== null) {
                    $attrLabel = $this->getLabel($attr);
                }

                App::$Session->getFlashBag()->add('warning', __('Field "%field%" is incorrect', ['field' => $attrLabel]));
            }
        }

        return $success;
    }
740026
protected function validateOauthCredential()
    {
        if (!$this->isPosted('save')) {
            return false;
        }

        $this->setSubmitted('credential');
        $this->validateElement(array('name' => $this->text('Name')), 'length', array(1, 255));
        $this->validateElement(array('data.id' => $this->text('Client ID')), 'length', array(1, 255));
        $this->validateElement(array('data.secret' => $this->text('Client secret')), 'length', array(1, 255));

        return !$this->hasErrors();
    }
348968
protected function validateUserPasswordInstall()
    {
        $field = 'user.password';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Password');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        list($min, $max) = $this->user->getPasswordLength();

        $length = mb_strlen($value);

        if ($length < $min || $length > $max) {
            $this->setErrorLengthRange($field, $label, $min, $max);
            return false;
        }

        return true;
    }
1051191
public function isValid()
    {
        // get the submitted value
        $value = $this->field->getForm()->getFieldValue($this->field->getName());

        // required but not given
        if ($this->required && $value == null) {
            return false;
        } // if the field is not required and the value is empty, then it's also valid
        elseif (!$this->required && $value == "") {
            return true;
        }

        // check if multiple values are returned and if this is allowed.
        if (is_array($value) && !$this->field->isMultiple()) {
            return false;
        }

        // check if the submitted value(s) are in the options value's
        $options = $this->field->getOptions();

        if (!is_array($value)) {
            $value = (array)$value;
        }

        // check if the selected options exist
        if (!$this->checkIfOptionsExists($value, $options)) {
            return false;
        }

        return true;
    }
549524
public function loginSuccess()
    {
        $this->userID = (int) $this->kontakt->getMyKey();
        $this->setUserLogin($this->kontakt->getDataValue($this->loginColumn));
        $this->logged = true;
        $this->addStatusMessage(sprintf(_('Sign in %s all ok'), $this->userLogin),
            'success');

        return true;
    }
251770
public function isLogged() {
        if ($this->isAuthenticated === false) {
            $this->isAuthenticated = $this->checkSession($this->getCurrentSessionHash());
        }
        return $this->isAuthenticated;
    }