Logs in a user using the provided username and password.
@return bool whether the user is logged in successfully
165544
public function login()
    {
        if ($this->validate()) {
            return Yii::getApp()->getUser()->login($this->getUser(), $this->rememberMe ? 3600*24*30 : 0);
        }
        return false;
    }
165799
public function login($username_or_email = '', $password = '')
	{
		if ( ! ($this->user = $this->validate_user($username_or_email, $password)))
		{
			$this->user = \Config::get('simpleauth.guest_login', true) ? static::$guest_login : false;
			\Session::delete('username');
			\Session::delete('login_hash');
			return false;
		}

		// register so Auth::logout() can find us
		Auth::_register_verified($this);

		\Session::set('username', $this->user['username']);
		\Session::set('login_hash', $this->create_login_hash());
		\Session::instance()->rotate();
		return true;
	}
520325
protected function validateUserLogin()
    {
        $this->setSubmitted('user', null, false);
        $this->filterSubmitted(array('email', 'password'));
        $this->validateComponent('user_login');

        return !$this->hasErrors();
    }
277149
public function login() {

		if ( $this->validate() ) {

			$user = $this->getUser();

			if( $this->admin ) {

				$user->loadPermissions();

				if( !$user->isPermitted( CoreGlobal::PERM_ADMIN ) ) {

					$this->addError( "email", Yii::$app->coreMessage->getMessage( CoreGlobal::ERROR_NOT_ALLOWED ) );

					return false;
				}
			}

			$user->lastLoginAt = DateUtil::getDateTime();

			$user->save();

			return Yii::$app->user->login( $user, $this->rememberMe ? $this->interval : 0 );
		}

		return false;
	}
1043247
public function user_login($username, $password) {
        $cached = $this->get_static_user_info();
        if (empty($cached)) {
            // This means we were called as part of a normal login flow - without using oauth.
            return false;
        }
        $verifyusername = $cached['username'];
        if ($verifyusername == $username) {
            return true;
        }
        return false;
    }
662831
public function login() {

        if( $this->validate() ) {

			$user = $this->getUser();

			$user->lastLoginAt = DateUtil::getDateTime();

			$user->save();

            return Yii::$app->user->login( $user, false );
        }

		return false;
    }
541227
private function login(){
        extract($this->config);
        $this->link = ftp_connect($host, $port, $timeout);
        if($this->link) {
            if (ftp_login($this->link, $username, $password)) {
               return true;
            } else {
                $this->error = "无法登录到FTP服务器：username - {$username}";
            }
        } else {
            $this->error = "无法连接到FTP服务器：{$host}";
        }
        return false;
    }
768055
public function login()
    {
        $success = false;
        if ($this->output && $this->input && $this->input->isInteractive()) {
            $method = $this->config()->getWithDefault('application.login_method', 'browser');
            if ($method === 'browser') {
                /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
                $questionHelper = $this->getService('question_helper');
                $urlService = $this->getService('url');
                if ($urlService->canOpenUrls()
                    && $questionHelper->confirm("Authentication is required.\nLog in via a browser?")) {
                    $this->stdErr->writeln('');
                    $exitCode = $this->runOtherCommand('auth:browser-login');
                    $this->stdErr->writeln('');
                    $success = $exitCode === 0;
                }
            } elseif ($method === 'password') {
                $exitCode = $this->runOtherCommand('auth:password-login');
                $this->stdErr->writeln('');
                $success = $exitCode === 0;
            }
        }
        if (!$success) {
            throw new LoginRequiredException();
        }
    }
239582
public function getIsLogin(){
        if(isset($_SESSION[$this->storeKey])) return true;
        if(!empty($_COOKIE[$this->storeKey])){
            $data = $this->authCode($_COOKIE[$this->storeKey],'DECODE');
            $this->identity = json_decode($data,true);
            $this->saveLoginSession();
        }
        return false;
    }
255961
public function isLoggedIn()
    {
        if ($this->instance instanceof \Phavour\Session\Storage) {
            if ($this->instance->get('identity') != false) {
                return true;
            }
        }

        return false;
    }
924143
public static function isLoggedIn()
    {
        // Check to see if Symphony exists, or if we already have an Author instance.
        if (is_null(self::$_instance) || self::$Author) {
            return true;
        }

        // No author instance found, attempt to log in with the cookied credentials
        return self::login(self::$Cookie->get('username'), self::$Cookie->get('pass'), true);
    }
910133
public function validLoggedInAdmin()
    {
        $loggedInUser = $this->getCurrentLoggedInUser();
        if ($loggedInUser
            && $loggedInUser->administrator
            && $loggedInUser->deleted === null
            && $loggedInUser->enabled) {
                return true;
        }
        return false;
    }
635418
public function login()
    {
        if ($this->validate()) {
            $loginHistory = new LoginHistory(['ip' => Yii::$app->request->userIP ?: '127.0.0.1']);
            $loginHistory->link('user', $this->user);
            return Yii::$app->user->login($this->user, $this->rememberMe ? $this->getSetting('rememberFor') : 0);
        } else {
            return false;
        }
    }
662985
public function login()
    {
        if (!$this->authenticate())
            return false;

        if($this->_identity->errorCode===RemoteUserIdentity::ERROR_NONE)
		{
            Yii::app()->user->logout();
			return Yii::app()->user->login($this->_identity,3600*24);
		}
		else
			return false;

    }
1040583
public function isLoggedIn()
    {
        $loggedIn = $this->di->get("session")->has("user");
        if (!$loggedIn) {
            $this->di->get("response")->redirect("user/login");
            return false;
        }
        return true;
    }
267891
public function login()
    {
        // TODO: Implement run() method.
        if (isset($_GET['logout'])) {
            $this->addMessage('Se ha desconectado correctamente');
            Session::delete($this->session_key);
            setcookie($this->session_key, '', 0, '/');
            $this->user = new User();
        }
        if ($this->requireLogin) {
            if (!Session::has($this->session_key)) {
                if (strpos(Server::get('REQUEST_URI'), '/login') === false) {
                    if (!isset($_GET['logout'])) {
                        $this->addMessage($this->reasonMessage, 'warning');
                    }
                    if (!isset($_GET['logout'])) {
                        Session::set('return', get_request_url());
                    }
                    $auth = "";
                    if (isset($_GET['auth'])) {
                        $auth = "?auth=" . $_GET['auth'];
                    }
                    $this->quit($this->config['app']['basepath'] . '/login' . $auth);
                    return false;
                }
            }
        }
        return true;
    }
1269331
protected function doLogin()
    {
        $connection = $this->connection;
        $user = $this->getParam('user');
        $password = $this->getParam('pass');

        return $this->retry(function () use ($connection, $user, $password) {
            $res = @ftp_login($connection, $user, $password);

            if (!$res) {
                throw new \RuntimeException("Login failed for user: ".$user);
            }
        });
    }