Login to the POP3 server (does not support APOP yet)
@access public
@param string $username
@param string $password
@return boolean
434049
public function Login ($username = '', $password = '') {
    if ($this->connected == false) {
      $this->error = 'Not connected to POP3 server';

      if ($this->do_debug >= 1) {
        $this->displayErrors();
      }
    }

    if (empty($username)) {
      $username = $this->username;
    }

    if (empty($password)) {
      $password = $this->password;
    }

    $pop_username = "USER $username" . $this->CRLF;
    $pop_password = "PASS $password" . $this->CRLF;

    //  Send the Username
    $this->sendString($pop_username);
    $pop3_response = $this->getResponse();

    if ($this->checkResponse($pop3_response)) {
      //  Send the Password
      $this->sendString($pop_password);
      $pop3_response = $this->getResponse();

      if ($this->checkResponse($pop3_response)) {
        return true;
      } else {
        return false;
      }
    } else {
      return false;
    }
  }
1002947
public function authenticate($username, $password) {
        if (!$this->hasPDO()) {
            return NULL;
        }

        $sql = $this->sql();

        /* @var $pdo \PDO */
        $pdo = $this->options["pdo"];
        $statement = $pdo->prepare($sql);
        $statement->execute(array($username));

        $success = false;
        $user = $statement->fetch(\PDO::FETCH_ASSOC);

        if ($user) {
            $success = password_verify($password, $user[$this->options["hash"]]);
        }

        if (!$success) {
            $this->error = new \SlimPower\Authentication\Error();
            return null;
        } else {
            $data = array();

            foreach ($this->options["show"] as $fieldname) {
                if (array_key_exists($fieldname, $user)) {
                    $data[$fieldname] = $user[$fieldname];
                }
            }

            return $data;
        }
    }
319
public function login($username, $password)
	{
		$response = $this->http->get($this->getUrl('oauth2/access_token'), array(
			'grant_type'	=>	'password ',
			'username'		=>	$username,
			'password'		=>	$password,
			'client_id'		=>	$this->appid,
			'client_secret'	=>	$this->appSecret,
		));
		$this->result = $response->json(true);
		if(!isset($this->result['error_code']))
		{
			return $this->accessToken = $this->result['access_token'];
		}
		else
		{
			throw new ApiException(isset($this->result['error']) ? $this->result['error'] : '', $this->result['error_code']);
		}
	}
1087338
public function authenticate($username, $password)
    {
        $auth = new AuthenticationService();
        $adapter = new LdapAdapter([$this->config()->options], $username, $password);
        return $auth->authenticate($adapter);
    }
1041525
public function login($username = 'anonymous', $password = '')
    {
        $result = $this->ftp->login($username, $password);

        if ($result === false) {
            throw new FtpException('Login incorrect');
        }

        return $this;
    }
1286691
public function stateless($username, $password)
    {
        $user = $this->sentinel->stateless(
            [
                'email'    => $username,
                'password' => $password,
            ]
        );

        if ( ! ($user instanceof CartalystUserInterface)) {
            return false;
        }

        // This is still a login, and while we don't want persistence, we do want it to be recorded
        $this->sentinel->getUserRepository()->recordLogin($user);

        event( new CmsUserLoggedIn($user, true) );
        return true;
    }
490428
public function connect($username, $password)
    {
        $error = parent::connect($username, $password);

        if ($error) {
            return $error;
        }

        return $this->load_script();
    }
694869
public function basicAuth($username, $password)
    {
        $this->auth = new BasicAuth($username, $password);
        return $this->auth;
    }
369506
function login($username, $password = '')
    {
        if (!($this->bitmap & self::MASK_CONSTRUCTOR)) {
            $this->bitmap |= self::MASK_CONSTRUCTOR;
            if (!$this->_connect()) {
                return false;
            }
        }

        if (!($this->bitmap & self::MASK_CONNECTED)) {
            return false;
        }

        $data = pack('CNa*', NET_SSH1_CMSG_USER, strlen($username), $username);

        if (!$this->_send_binary_packet($data)) {
            user_error('Error sending SSH_CMSG_USER');
            return false;
        }

        $response = $this->_get_binary_packet();

        if ($response === true) {
            return false;
        }
        if ($response[self::RESPONSE_TYPE] == NET_SSH1_SMSG_SUCCESS) {
            $this->bitmap |= self::MASK_LOGIN;
            return true;
        } elseif ($response[self::RESPONSE_TYPE] != NET_SSH1_SMSG_FAILURE) {
            user_error('Expected SSH_SMSG_SUCCESS or SSH_SMSG_FAILURE');
            return false;
        }

        $data = pack('CNa*', NET_SSH1_CMSG_AUTH_PASSWORD, strlen($password), $password);

        if (!$this->_send_binary_packet($data)) {
            user_error('Error sending SSH_CMSG_AUTH_PASSWORD');
            return false;
        }

        // remove the username and password from the last logged packet
        if (defined('NET_SSH1_LOGGING') && NET_SSH1_LOGGING == self::LOG_COMPLEX) {
            $data = pack('CNa*', NET_SSH1_CMSG_AUTH_PASSWORD, strlen('password'), 'password');
            $this->message_log[count($this->message_log) - 1] = $data;
        }

        $response = $this->_get_binary_packet();

        if ($response === true) {
            return false;
        }
        if ($response[self::RESPONSE_TYPE] == NET_SSH1_SMSG_SUCCESS) {
            $this->bitmap |= self::MASK_LOGIN;
            return true;
        } elseif ($response[self::RESPONSE_TYPE] == NET_SSH1_SMSG_FAILURE) {
            return false;
        } else {
            user_error('Expected SSH_SMSG_SUCCESS or SSH_SMSG_FAILURE');
            return false;
        }
    }
404406
public function checkUserCredentials($username, $password)
    {
        $this->user = $this->app['auth']->getUserWithCredentials($username, $password);

        return $this->user instanceof User;
    }
142194
protected function _login($username, $password, $application)
    {
        // If we did receive the user credentials from the user, try to login
        if($application->login(array('username' => $username, 'password' => $password)) !== true) {
            return false;
        }

        // If we have logged in succesfully, make sure to fullfil
        // Koowa's CSRF authenticator checks if the framework is loaded.
        if (class_exists('Koowa'))
        {
            $manager = KObjectManager::getInstance();

            $request = $manager->getInstance()->getObject('com:koowa.dispatcher.request');
            $user    = $manager->getInstance()->getObject('user');
            $token   = $user->getSession()->getToken();

            $request->setReferrer(JUri::root());
            $request->getHeaders()->add(array('X-Xsrf-Token' => $token));
            $request->getCookies()->add(array('csrf_token' => $token));
        }

        return true;
    }
934189
public function login($username, $password)
    {
        $args = array($username, $password);
        $token = $this->_soapAdapter->call('login', $args);
        $this->setToken($token);
        return $token;
    }
532767
public static function signIn($username , $password)
	{
		$ip = self::getClientIp();
		$ua = ( isset( $_SERVER['HTTP_USER_AGENT'] ) ) ? $_SERVER['HTTP_USER_AGENT'] : '';
		$ts = date("U");

		if ( self::isValidPassword($username , $password) ) {

			self::sessionWrite( array( 'username' => $username ) );
			self::reload();
			self::$auth['users'][ $username ]['logincount'] = (int) @self::$auth['users'][ $username ]['logincount'] + 1;
			self::$auth['users'][ $username ]['lastlogin'] = array(
				'ip' => $ip,
				'ua' => $ua,
				'ts' => $ts
			);
			self::log( 'signin' , $username , $ts , $ip , $ua );
			self::save();

			return self::$auth['users'][ $username ];
		}

		self::log( 'signinerr' , $username , $ts , $ip , $ua );
		self::save();

		return false;
	}
294278
public function authenticate($username, $password)
	{
		$this->debug->groupCollapsed(__METHOD__);
		$return = false;
		$users = $this->search(array(
			'username'	=> $username,
			'email'		=> $username,
		));
		if ($users && $this->verifyPassword($password, $users[0]['password'])) {
			$this->debug->info('login success');
			$this->log('login', $users[0]['userid']);
			$return = $users[0]['userid'];
		} else {
			$this->debug->warn('login failed');
			$userid = $users
				? $users[0]['userid']
				: null;
			$this->log('loginFail', $userid);
		}
		$this->debug->groupEnd();
		return $return;
	}
978790
public static function isValidPassword($username , $password)
	{
		if ( ! self::userExists( $username ) ) return false;
		$compute = self::getPasswordHash($username , $password);

		return ( $compute === self::$auth['users'][$username]['pwd'] );
	}
296763
public static function login($username, $password) {
		if ($user = user::find($username, $password)) {
			self::$user           = $user;
			self::$isGuest        = false;
			$_SESSION["username"] = $username;

			return true;
		}

		return false;
	}
291707
public function createUser($username, $password, $privilege = null)
    {
        $query = sprintf('CREATE USER %s WITH PASSWORD \'%s\'', $username, $password);

        if ($privilege) {
            $query .= " WITH $privilege PRIVILEGES";
        }

        return $this->client->query(null, $query);
    }