Ldap
extends AbstractAuth
in package
Ldap auth class
Tags
Table of Contents
- NOT_VALID = 0
- Constant for auth result
- VALID = 1
- $host : string
- Ldap host
- $options : array<string|int, mixed>
- Ldap options
- $password : string
- Authentication password
- $port : string
- Ldap port
- $resource : resource
- Ldap resource
- $result : int
- Authentication result
- $username : string
- Authentication username
- __construct() : mixed
- Constructor
- authenticate() : int
- Method to authenticate
- getHost() : string
- Get the host
- getOption() : mixed
- Get an option
- getOptions() : array<string|int, mixed>
- Get options
- getPassword() : string
- Get the password
- getPort() : string
- Get the port
- getResource() : resource
- Get the Ldap resource
- getResult() : int
- Get the authentication result
- getUsername() : string
- Get the username
- isValid() : bool
- Determine if the authentication attempt was valid
- resource() : resource
- Get the Ldap resource (alias)
- setHost() : string
- 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
$host
= null
$options
Ldap options
protected
array<string|int, mixed>
$options
= []
$password
Authentication password
protected
string
$password
= null
$port
Ldap port
protected
string
$port
= null
$resource
Ldap resource
protected
resource
$resource
= null
$result
Authentication result
protected
int
$result
= 0
$username
Authentication username
protected
string
$username
= null
Methods
__construct()
Constructor
public
__construct(string $host[, string $port = null ][, array<string|int, mixed> $options = null ]) : mixed
Instantiate the Ldap auth adapter object
Parameters
- $host : string
- $port : string = null
- $options : array<string|int, mixed> = null
Return values
mixed —authenticate()
Method to authenticate
public
authenticate(string $username, string $password) : int
Parameters
- $username : string
- $password : string
Return values
int —getHost()
Get the host
public
getHost() : string
Return values
string —getOption()
Get an option
public
getOption(mixed $option) : mixed
Parameters
- $option : mixed
Return values
mixed —getOptions()
Get options
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —getPassword()
Get the password
public
getPassword() : string
Return values
string —getPort()
Get the port
public
getPort() : string
Return values
string —getResource()
Get the Ldap resource
public
getResource() : resource
Return values
resource —getResult()
Get the authentication result
public
getResult() : int
Return values
int —getUsername()
Get the username
public
getUsername() : string
Return values
string —isValid()
Determine if the authentication attempt was valid
public
isValid() : bool
Return values
bool —resource()
Get the Ldap resource (alias)
public
resource() : resource
Return values
resource —setHost()
Set the host
public
setHost(string $host) : string
Parameters
- $host : string
Return values
string —setOption()
Set an option
public
setOption(mixed $option, mixed $value) : Ldap
Parameters
- $option : mixed
- $value : mixed
Return values
Ldap —setOptions()
Set options
public
setOptions(array<string|int, mixed> $options) : Ldap
Parameters
- $options : array<string|int, mixed>
Return values
Ldap —setPassword()
Set the password
public
setPassword(string $password) : AbstractAuth
Parameters
- $password : string
Return values
AbstractAuth —setPort()
Set the port
public
setPort(string $port) : Ldap
Parameters
- $port : string
Return values
Ldap —setUsername()
Set the username
public
setUsername(string $username) : AbstractAuth
Parameters
- $username : string
Return values
AbstractAuth —verify()
Method to verify a password against a hash
public
verify(string $password, string $hash) : bool
Parameters
- $password : string
- $hash : string