Core/Auth/Auth.php
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;
    }
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;
    }
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 ; }
Try to login user with passed parameters.

@param string $username
@param string $password
@return bool
Try to login user with passed parameters .