Basic
Less than 1 minute
Basic
class Basic implements \Hazaar\Warlock\Server\Interface\AuthenticatorImplements: Hazaar\Warlock\Server\Interface\Authenticator
Properties
authDB
private BTree $authDBType: Hazaar\Util\BTree
Methods
__construct
Basic constructor.
public __construct(string $dbFile, bool $createDatabase): voidParameters
| Parameter | Type | Description |
|---|---|---|
$dbFile | string | the path to the authentication database file (BTree format) |
$createDatabase | bool |
authenticate
Authenticate a client using the provided username and password.
public authenticate(string $username, string $password, ?Client $client): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username provided by the client |
$password | string | the password provided by the client |
$client | Hazaar\Warlock\Server\Client |
exists
Check whether a user exists in the authentication database.
public exists(string $username): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | the username to look up |
addUser
public addUser(string $username, string $password): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string | |
$password | string |
removeUser
public removeUser(string $username): boolReturns: bool
Parameters
| Parameter | Type | Description |
|---|---|---|
$username | string |
listUsers
public listUsers(): arrayReturns: array
Generated by Hazaar API Doc Generator on Fri, 04 Sep 2026 23:32:17 +0000