Container for authentication filters.
This is the main class of the authentication component. Filters are added to an object of this class, which will run the filters in sequence. At the end of this process, the status property will contain the statuses of the filters, and the developer can use those statuses to display to the user messages such as "Password incorrect".
The session property is optional and it is used to store the authentication information between requests.
The credentials property will be passed to all the filters in the queue.
Example (using the Htpasswd filter):
Source for this file: /Authentication/src/authentication.php
Version: | //autogen// |
ezcAuthenticationCredentials | read/write |
$credentials
The user credentials to pass to the authentication filters. |
ezcAuthenticationSession | read/write |
$session
The session object to use during authentication to store the authentication information between requests. |
ezcAuthenticationStatus | read/write |
$status
The status object which holds the status of the run filters. |
protected array(ezcAuthenticationFilter) |
$filters
= array()
The filter queue of the authentication process. |
protected ezcAuthenticationOptions |
$options
Options for the Authentication object. |
public ezcAuthentication |
__construct(
$credentials
, [ $options
= null] )
Creates a new object of this class. |
public void |
addFilter(
$filter
, [ $stop
= false] )
Adds an authentication filter at the end of the filter list. |
public ezcAuthenticationOptions |
getOptions(
)
Returns the options of this class. |
public array(string=>mixed) |
getStatus(
)
Returns the status of authentication. |
public bool |
run(
)
Runs through all the filters in the filter list. |
public void |
setOptions(
$options
)
Sets the options of this class to $options. |
Creates a new object of this class.
Name | Type | Description |
---|---|---|
$credentials |
ezcAuthenticationCredentials | Authentication credentials |
$options |
ezcAuthenticationOptions | Options for this class |
Adds an authentication filter at the end of the filter list.
By specifying the second parameter as true, the authentication process (triggered by calling the run() method) will stop after processing this filter regardless of its success.
Name | Type | Description |
---|---|---|
$filter |
ezcAuthenticationFilter | The authentication filter to add |
$stop |
bool | If authentication should continue past this filter |
Returns the options of this class.
Returns the status of authentication.
The format of the returned array is array( array( class => code ) ).
Example:
Runs through all the filters in the filter list.
Sets the options of this class to $options.
Name | Type | Description |
---|---|---|
$options |
ezcAuthenticationOptions | Options for this class |