Attempts to authenticate based on the provided username/password.  if
successful, the object is populated with data from the data store

@param string $username
@param string $password
@return bool true if login was successful
512478
function Login($username, $password)
	{
		// for backwards compatibility with Phreeze 2x, look in multiple places for the AccountCriteria class
		if (!class_exists("AccountCriteria")) @include_once("Model/AccountCriteria.php");
		if (!class_exists("AccountCriteria")) @include_once("Model/DAO/AccountCriteria.php");
		if (!class_exists("AccountCriteria")) throw new Exception("Unable to locate AccountCriteria class.");
		
		if ($username == "" || $password == "")
		{
			return false;
		}
		
		$this->_phreezer->Observe("AuthAccount.Login Searching For Matching Account...");

		$criteria = new AccountCriteria();
		// set both the name and the _Equals properties for backwards compatibility
		if (property_exists($criteria,'Username')) $criteria->Username = $username;
		$criteria->Username_Equals = $username;
		if (property_exists($criteria,'Password')) $criteria->Password = base64_encode(crypt($password,$username));
		$criteria->Password_Equals = base64_encode(crypt($password,$username));
		
		$ds = $this->_phreezer->Query("Account", $criteria);
		
		// we have to clear the cache, this resolves an issue where logging in repeatedly 
		// will retain the same cached child objects
		$this->ClearCache();
		
		if ($account = $ds->Next())
		{
			// we can't do $this = $account, so instead just clone all the properties:
			$this->LoadFromObject($account);
			$this->GetRole(); // this triggers the role to load so it will be cached
			
			// we need to update the login date and count
			//$this->LastLogin = date('Y-m-d H:i:s');
			//$this->LoginCount++;
			//$this->Save();

			return true;
		}
		else
		{
			return false;
		}
	}
169018
public function setUsername($username, $password = null) {
		$this->username = (string) $username;
		
		if ($password !== null) {
			$this->setPassword($password);
		}
		
		return $this;
	}
969046
public function plainAuth(string $username, string $password): bool
    {
        $resource = $this->ldap->getResource();

        $esc_username = ldap_escape($username);
        $filter = htmlspecialchars_decode(sprintf($this->account_filter, $esc_username));
        $result = ldap_search($resource, $this->ldap->getBase(), $filter, ['dn', $this->identity_attribute]);
        $entries = ldap_get_entries($resource, $result);

        if (0 === $entries['count']) {
            $this->logger->warning("user not found with ldap filter [{$filter}]", [
                'category' => get_class($this),
            ]);

            return false;
        }
        if ($entries['count'] > 1) {
            $this->logger->warning("more than one user found with ldap filter [{$filter}]", [
                'category' => get_class($this),
            ]);

            return false;
        }

        $dn = $entries[0]['dn'];
        $this->logger->info("found ldap user [{$dn}] with filter [{$filter}]", [
            'category' => get_class($this),
        ]);

        $result = ldap_bind($resource, $dn, $password);
        $this->logger->info("bind ldap user [{$dn}]", [
            'category' => get_class($this),
            'result' => $result,
        ]);

        if (false === $result) {
            return false;
        }

        if (!isset($entries[0][$this->identity_attribute])) {
            throw new Exception\IdentityAttributeNotFound('identity attribute not found');
        }

        $this->identifier = $entries[0][$this->identity_attribute][0];
        $this->ldap_dn = $dn;

        return true;
    }
922197
public function login($username, $password)
    {
        $stmt = $this->conn->prepare(
            sprintf("SELECT user_id, user_name, user_pass
			FROM %s WHERE user_name = :name LIMIT 1", $this->table));
        $stmt->execute(['name' => $username]);

        $result = $stmt->fetch(\PDO::FETCH_ASSOC);

        if ($result['user_name'] !== $username) {
            return false;
        }

        if ($this->hasher->CheckPassword($password, $result['user_pass'])) {
            // Clear previous session
            $this->session->regenerate();
            // Write new data to session
            $data = [
                'id' => $result['user_id'],
                'logged_' . $this->table => true
            ];
            $this->session->set('user', $data);
            return true;
        }
        return false;
    }
1238204
public function login($username, $password)
    {
        $data = $this->matrix()->request('POST', $this->endpoint('login'), [
            'type' => 'm.login.password',
            'user' => $username,
            'password' => $password
        ]);
        $this->setData($data);
        return $this->data;
    }
1004058
function login($username, $password = '')
    {
        if (!parent::login($username, $password)) {
            return false;
        }

        $this->window_size_client_to_server[NET_SFTP_CHANNEL] = $this->window_size;

        $packet = pack('CNa*N3',
            NET_SSH2_MSG_CHANNEL_OPEN, strlen('session'), 'session', NET_SFTP_CHANNEL, $this->window_size, 0x4000);

        if (!$this->_send_binary_packet($packet)) {
            return false;
        }

        $this->channel_status[NET_SFTP_CHANNEL] = NET_SSH2_MSG_CHANNEL_OPEN;

        $response = $this->_get_channel_packet(NET_SFTP_CHANNEL);
        if ($response === false) {
            return false;
        }

        $packet = pack('CNNa*CNa*',
            NET_SSH2_MSG_CHANNEL_REQUEST, $this->server_channels[NET_SFTP_CHANNEL], strlen('subsystem'), 'subsystem', 1, strlen('sftp'), 'sftp');
        if (!$this->_send_binary_packet($packet)) {
            return false;
        }

        $this->channel_status[NET_SFTP_CHANNEL] = NET_SSH2_MSG_CHANNEL_REQUEST;

        $response = $this->_get_channel_packet(NET_SFTP_CHANNEL);
        if ($response === false) {
            return false;
        }

        $this->channel_status[NET_SFTP_CHANNEL] = NET_SSH2_MSG_CHANNEL_DATA;

        if (!$this->_send_sftp_packet(NET_SFTP_INIT, "\0\0\0\3")) {
            return false;
        }

        $response = $this->_get_sftp_packet();
        if ($this->packet_type != NET_SFTP_VERSION) {
            user_error('Expected SSH_FXP_VERSION', E_USER_NOTICE);
            return false;
        }

        extract(unpack('Nversion', $this->_string_shift($response, 4)));
        $this->version = $version;
        while (!empty($response)) {
            extract(unpack('Nlength', $this->_string_shift($response, 4)));
            $key = $this->_string_shift($response, $length);
            extract(unpack('Nlength', $this->_string_shift($response, 4)));
            $value = $this->_string_shift($response, $length);
            $this->extensions[$key] = $value;
        }

        /*
         SFTPv4+ defines a 'newline' extension.  SFTPv3 seems to have unofficial support for it via 'newline@vandyke.com',
         however, I'm not sure what 'newline@vandyke.com' is supposed to do (the fact that it's unofficial means that it's
         not in the official SFTPv3 specs) and 'newline@vandyke.com' / 'newline' are likely not drop-in substitutes for
         one another due to the fact that 'newline' comes with a SSH_FXF_TEXT bitmask whereas it seems unlikely that
         'newline@vandyke.com' would.
        */
        /*
        if (isset($this->extensions['newline@vandyke.com'])) {
            $this->extensions['newline'] = $this->extensions['newline@vandyke.com'];
            unset($this->extensions['newline@vandyke.com']);
        }
        */

        $this->request_id = 1;

        /*
         A Note on SFTPv4/5/6 support:
         <http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-5.1> states the following:

         "If the client wishes to interoperate with servers that support noncontiguous version
          numbers it SHOULD send '3'"

         Given that the server only sends its version number after the client has already done so, the above
         seems to be suggesting that v3 should be the default version.  This makes sense given that v3 is the
         most popular.

         <http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-5.5> states the following;

         "If the server did not send the "versions" extension, or the version-from-list was not included, the
          server MAY send a status response describing the failure, but MUST then close the channel without
          processing any further requests."

         So what do you do if you have a client whose initial SSH_FXP_INIT packet says it implements v3 and
         a server whose initial SSH_FXP_VERSION reply says it implements v4 and only v4?  If it only implements
         v4, the "versions" extension is likely not going to have been sent so version re-negotiation as discussed
         in draft-ietf-secsh-filexfer-13 would be quite impossible.  As such, what Net_SFTP would do is close the
         channel and reopen it with a new and updated SSH_FXP_INIT packet.
        */
        switch ($this->version) {
            case 2:
            case 3:
                break;
            default:
                return false;
        }

        $this->pwd = $this->_realpath('.', false);

        $this->_save_dir($this->pwd);

        return true;
    }
744973
public function checkUserCredentials($username, $password)
	{
		// allow authentication via email, just like in the hub
		if (strpos($username, '@'))
		{
			$username = $this->getUsernameFromEmail($username);
		}

		// use hubzero password library to compare stored password with sent password
		$match = Password::passwordMatches($username, $password, true);

		// return if match was found
		return (bool) $match;
	}
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;
    }
1190852
public function authentication($username, $password)
    {
        $endpoint = sprintf('authentication?username=%s', urlencode($username));
        $parameters['value'] = $password;
        return $this->apiClient->callEndpoint(
            $endpoint,
            $parameters,
            null,
            HttpMethod::REQUEST_POST
        );
    }
620286
public function logIn($username,$password) {
		session_regenerate_id(true);
		$sql = "SELECT id,password FROM {$this->primaryTable} WHERE username=:username AND inactive=0";
		if ($result = $this->executeQuery($sql,array(":username"=>$username))) {
			if (password_verify($password,$result[0]['password'])) {
				$this->setSessionUserId($result[0]['id']);
				return true;			
			}
		}
		return false;
	}
1205297
public function setPassword($password)
    {
        if(!$this->isValidPassword($password)){
            return false;
        }

        if ($this->setPasswordStatement === null) {
            $this->setPasswordStatement = $this->connection->prepare("UPDATE User SET password=? WHERE username=?");
            $this->setPasswordStatement->bindParam(1, $this->password);
            $this->setPasswordStatement->bindParam(2, $this->username);
        }
        $wasLoggedIn = $this->isLoggedIn();
        $this->password = $this->hashPassword($password);
        $this->setPasswordStatement->execute();

        if ($wasLoggedIn) {

            $this->updateLoginSession();
        }

        return true;
    }
136210
public function login($login, $password) {
		$user = $this->findUser($login);

		if ($user) {
			$this->user = $user;
			$this->recognized = true;

			if ($this->verifyUser($user, $password)) {
				$this->authenticated = true;

				$session = $this->findSession($user);
				if ($session === null) {
					$session = $this->createSession($user);
				}

				$this->session = $session;
				return true;
			}
		}

		return false;
	}
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;
    }
560474
public function isValidUser($userName, $password)
    {
        $filter = new IteratorFilter();
        $passwordGenerator = $this->getUserDefinition()->getClosureForUpdate('password');
        $filter->addRelation($this->getUserDefinition()->loginField(), Relation::EQUAL, strtolower($userName));
        $filter->addRelation(
            $this->getUserDefinition()->getPassword(),
            Relation::EQUAL,
            $passwordGenerator($password, null)
        );
        return $this->getUser($filter);
    }
373148
public function updatePassword($username, $password)
    {
        /** @var UserInterface|EloquentUser $user */
        if ( ! ($user = $this->sentinel->findByCredentials(['email' => $username]))) {
            return false;
        }

        return $this->sentinel->update($user, ['password' => $password]) instanceof UserInterface;
    }
622005
protected function onLogin($userName, $password)
    {
        /** Demo shop log in */
        if (!$this->isLoaded() && $this->_isDemoShop() && $this->isAdmin()) {
            $database = DatabaseProvider::getDb();
            $userId = $database->getOne($this->_getDemoShopLoginQuery($userName, $password));
            if ($userId) {
                $this->load($userId);
            }
        }
    }
818384
public function verify($user, $password)
    {
        $this->load();
        if (!isset($this->users[$user])) {
            return false;
        }
        return $this->users[$user]->verify($password);
    }