Checks whether logon

@return array|bool|mixed
518582
public function isAuthorised()
    {

        if (is_array($this->user) === true
            && isset($this->user['error']) === false
        ) {

            return true;
        }

        return $this->getUser();
    }
865262
public function isLoggedIn()
    {
        $roleModel = new \erdiko\users\models\Role;
        $roleGeneral = $roleModel->findByName('user');

		// @todo update exception message for clarity
        if (empty($roleGeneral)){
            throw  new \Exception('Error, role user not found.');
        }

		return ( ( $this->_user->getId() > 0 ) && ( $this->_user->getRole() !== $roleGeneral->getId() ) );
	}
392882
public function logout()
    {
        if (!$this->is_loggedin) {
            return false;
        }

        $this->exec_curl('/logout');
        $this->is_loggedin = false;
        $this->cookies     = '';

        return true;
    }
853766
public function isAdmin(): bool
    {
        return $this->isLoggedIn()
            && isset($this->session->get('user')['admin'])
            && $this->session->get('user')['admin'] === true;
    }
1143981
public function authenticate(): bool
    {
        if (!isset($_SERVER['HTTP_AUTHORIZATION'])) {
            $this->logger->debug('skip auth adapter ['.get_class($this).'], no http authorization header found', [
                'category' => get_class($this),
            ]);

            return false;
        }

        $header = $_SERVER['HTTP_AUTHORIZATION'];
        $parts = explode(' ', $header);

        if ('Basic' === $parts[0]) {
            $this->logger->debug('found http basic authorization header', [
                'category' => get_class($this),
            ]);

            $username = $_SERVER['PHP_AUTH_USER'];
            $password = $_SERVER['PHP_AUTH_PW'];

            return $this->plainAuth($username, $password);
        }
        $this->logger->warning('http authorization header contains no basic string or invalid authentication string', [
                'category' => get_class($this),
            ]);

        return false;
    }
554813
public function logout()
    {
        $this->_session->delete('auth');
        $this->_session->delete('expire');
        $this->_session->delete('_token');
        $this->_session->delete('_token_meta');

        return $this->check() ? false : true;
    }
498144
public function isAuthenticated()
		{

			// Already authenticated?
			if ($this->_authenticated) return true;


			// Check session
			if (array_key_exists(self::$_sessionPrefix . $this->_name, $_SESSION)) {

				// Get credentials
				$cred = $_SESSION[self::$_sessionPrefix . $this->_name];
				
				// Init model
				$this->_initModel();

				// Find user
				$modelName = $this->_model;
				$user = $modelName::find("first", array(
							$this->_usernameField => $cred['username'],
							$this->_passwordField => $cred['password']
						));

				// Anything?
				if (is_null($user)) {
					return false;
				}

				// Set result
				$this->_result = new AuthResult(AuthResult::SUCCESS, $user);
				$this->_authenticated = true;
				$this->_user = $user;
				return true;

			}

			// Not authenticated.
			return false;

		}
1242815
public function afterLogout(): bool
    {
        $token = \Yii::$app->getRequest()->getCookies()->getValue('auth_token');
        $websiteToken = $this->__userAccessTokenClass::findOne(['user_id' => $this->id, 'access_token' => $token]);
        if ($websiteToken instanceof $this->__userAccessTokenClass) {
            $websiteToken->deactivate();
        }
        \Yii::$app->getResponse()->getCookies()->remove('auth_token');
        return true;
    }
1113136
public function logout()
    {
        $username = $this->httpRequest()->post('username');
        $session = $this->httpRequest()->post('authToken');

        $this->getLoginInstance()->revokeSessions($username, $session);

        return ['result' => 'success'];
    }
831326
public function isLogged() {
        if (!$this->isLogged) return false;
        if ($this->genUID()!=$this->uid) return false; // uid doesn't correspond.
        return true;
    }
532666
public function isAuthenticated()
    {
        if(!array_key_exists(self::AUTHENTICATED, $this->_map))
            return false;

        $authc      = $this->_map[self::AUTHENTICATED];
        $authStatus = ($authc != null && $authc);
        return $authStatus;
    }
433443
public function checkCredentials()
    {
        try {
            $requestHeader = array_merge_recursive($this->httpHeader, $this->config->getShopHeader());

            $request = $this->messageFactory->createRequest(
                'GET',
                $this->config->getBaseUrl() . '/engine/rest/merchants/',
                $requestHeader
            );
            $request = $this->basicAuth->authenticate($request);
            $responseCode = $this->httpClient->sendRequest($request)->getStatusCode();
        } catch (TransferException $e) {
            $this->getLogger()->debug('Check credentials: Error - ' . $e->getMessage());
            return false;
        }

        if ($responseCode === 404) {
            $this->getLogger()->debug('Check credentials: Valid');
            return true;
        }

        $this->getLogger()->debug('Check credentials: Invalid - Received status code: ' . $responseCode);
        return false;
    }
1205688
public function login()
    {
        if (!$this->id()) {
            return false;
        }

        $this->setLastLoginDate('now');
        $ip = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
        if ($ip) {
            $this->setLastLoginIp($ip);
        }

        $this->update([ 'last_login_ip', 'last_login_date' ]);

        $this->saveToSession();

        return true;
    }
687323
public function isLoggedIn($hardCheck = false)
    {
        if (empty($this->loginData[self::ID_LOGIN])) {
            return false;
        }

        if ($hardCheck || !$this->isAuthConfirmed()) {
            $this->confirmAuth();
        }

        return $this->isAuthConfirmed() && $this->getLogoutDate()->getTimestamp() > time();
    }
1076582
public function isLoggedIn() {
		return isset($_SESSION) && isset($_SESSION[self::SESSION_FIELD_LOGGED_IN]) && $_SESSION[self::SESSION_FIELD_LOGGED_IN] === true;
	}
45823
public function is_authenticated() {
		$retval = false;
		$parentRes = false;
		
		try {
			if(parent::is_authenticated()) {
				$parentRes = true;
				$retval = $this->is_valid_sid($this->sid);
			}
		}
		catch(Exception $e) {
			$this->exception_handler($e->getMessage());
		}
		
		return ($retval);
	}
1351132
public function logout(): bool
    {
        if ($this->values->offsetExists('principal')) {
            $principal = $this->getPrincipal();
            $this->principal = Principal::getAnonymous();

            $this->session->destroy();

            $this->logger->info(
                "Authentication logout: {user}",
                ['user' => $principal]
            );
            return $this->publishLogout($principal);
        }
        return false;
    }