Ldap
extends AbstractAuth
in package
Ldap auth class
Tags
Table of Contents
Constants
Properties
- $host : string|null
- Ldap host
- $options : array<string|int, mixed>
- Ldap options
- $password : string|null
- Authentication password
- $port : string|int|null
- Ldap port
- $resource : mixed
- Ldap resource
- $result : int
- Authentication result
- $username : string|null
- Authentication username
Methods
- __construct() : mixed
- Constructor
- authenticate() : int
- Method to authenticate
- getHost() : string|null
- Get the host
- getOption() : mixed
- Get an option
- getOptions() : array<string|int, mixed>
- Get options
- getPassword() : string|null
- Get the password
- getPort() : string|int|null
- Get the port
- getResource() : mixed
- Get the Ldap resource
- getResult() : int
- Get the authentication result
- getUsername() : string|null
- Get the username
- isAuthenticated() : bool
- Determine if the authentication attempt was successful
- resource() : mixed
- Get the Ldap resource (alias)
- setHost() : Ldap
- Set the host
- setOption() : Ldap
- Set an option
- setOptions() : Ldap
- Set options
- setPassword() : AbstractAuth
- Set the password
- setPort() : Ldap
- Set the port
- setUsername() : AbstractAuth
- Set the username
- verify() : bool
- Method to verify a password against a hash
Constants
NOT_VALID
Constant for auth result
public
int
NOT_VALID
= 0
VALID
public
mixed
VALID
= 1
Properties
$host
Ldap host
protected
string|null
$host
= null
$options
Ldap options
protected
array<string|int, mixed>
$options
= []
$password
Authentication password
protected
string|null
$password
= null
$port
Ldap port
protected
string|int|null
$port
= null
$resource
Ldap resource
protected
mixed
$resource
= null
$result
Authentication result
protected
int
$result
= 0
$username
Authentication username
protected
string|null
$username
= null
Methods
__construct()
Constructor
public
__construct(string $host[, string|int|null $port = null ][, array<string|int, mixed>|null $options = null ]) : mixed
Instantiate the Ldap auth adapter object
Parameters
- $host : string
- $port : string|int|null = null
- $options : array<string|int, mixed>|null = null
authenticate()
Method to authenticate
public
authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
intgetHost()
Get the host
public
getHost() : string|null
Return values
string|nullgetOption()
Get an option
public
getOption(mixed $option) : mixed
Parameters
- $option : mixed
getOptions()
Get options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>getPassword()
Get the password
public
getPassword() : string|null
Return values
string|nullgetPort()
Get the port
public
getPort() : string|int|null
Return values
string|int|nullgetResource()
Get the Ldap resource
public
getResource() : mixed
getResult()
Get the authentication result
public
getResult() : int
Return values
intgetUsername()
Get the username
public
getUsername() : string|null
Return values
string|nullisAuthenticated()
Determine if the authentication attempt was successful
public
isAuthenticated() : bool
Return values
boolresource()
Get the Ldap resource (alias)
public
resource() : mixed
setHost()
Set the host
public
setHost(string $host) : Ldap
Parameters
- $host : string
Return values
LdapsetOption()
Set an option
public
setOption(mixed $option, mixed $value) : Ldap
Parameters
- $option : mixed
- $value : mixed
Return values
LdapsetOptions()
Set options
public
setOptions(array<string|int, mixed> $options) : Ldap
Parameters
- $options : array<string|int, mixed>
Return values
LdapsetPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuthsetPort()
Set the port
public
setPort(string|int $port) : Ldap
Parameters
- $port : string|int
Return values
LdapsetUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuthverify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string