Group authentication filters together.
If there are no filters in the group, then the run() method will return STATUS_OK.
The way of grouping the filters is specified with the mode option:
Example of using the group filter with LDAP and Database filters:
It is possible to use multiple credentials when grouping filters together, by enabling the option multipleCredentials for the Group filter object. When this option is enabled, each filter added to the group must have a credentials object passed along with it.
Example of using the Group filter to handle multiple credentials:
Source for this file: /Authentication/src/filters/group/group_filter.php
ezcAuthenticationFilter | --ezcAuthenticationGroupFilter
Version: | //autogen// |
MODE_AND
= 2
|
All the filters need to succeed in order for the group to succeed. |
MODE_OR
= 1
|
At least one filter needs to succeed in order for the group to succeed. |
STATUS_GROUP_FAILED
= 1
|
All or some of the filters in the group failed (depeding on the mode option). |
From ezcAuthenticationFilter: | |
---|---|
ezcAuthenticationFilter::STATUS_OK
|
Successful authentication. |
ezcAuthenticationStatus | read/write |
$status
The status object which holds the status of the run filters. |
protected array(ezcAuthenticationFilter) |
$filters
= array()
Authentication filters. |
From ezcAuthenticationFilter | |
---|---|
protected |
ezcAuthenticationFilter::$options
|
public ezcAuthenticationGroupFilter |
__construct(
$filters
, [ $options
= null] )
Creates a new object of this class. |
public void |
addFilter(
$filter
, [ $credentials
= null] )
Adds an authentication filter at the end of the filter list. |
public int |
run(
$credentials
)
Runs the filter and returns a status code when finished. |
From ezcAuthenticationFilter | |
---|---|
public ezcAuthenticationFilterOptions |
ezcAuthenticationFilter::getOptions()
Returns the options of this class. |
public abstract int |
ezcAuthenticationFilter::run()
Runs the filter and returns a status code when finished. |
public void |
ezcAuthenticationFilter::setOptions()
Sets the options of this class to $options. |
Creates a new object of this class.
The filters can be specified as an array of filter objects, or as an array of array(fiter,credentials) when the multipleCredentials option is enabled.
Example of using multipleCredentials:
Name | Type | Description |
---|---|---|
$filters |
array(ezcAuthenticationFilter|mixed) | Authentication filters |
$options |
ezcAuthenticationGroupOptions | Options for this class |
Type | Description |
---|---|
ezcAuthenticationException |
if the multipleCredentials option is enabled and a credentials object was not specified |
Adds an authentication filter at the end of the filter list.
Example of using multipleCredentials:
Name | Type | Description |
---|---|---|
$filter |
ezcAuthenticationFilter | The authentication filter to add |
$credentials |
ezcAuthenticationCredentials | Credentials object associated with $filter if the multipleCredentials option is enabled |
Type | Description |
---|---|
ezcAuthenticationGroupException |
if the multipleCredentials option is enabled and a credentials object was not specified |
Runs the filter and returns a status code when finished.
Name | Type | Description |
---|---|---|
$credentials |
ezcAuthenticationCredentials | Authentication credentials |
Method | Description |
---|---|
ezcAuthenticationFilter::run() |
Runs the filter and returns a status code when finished. |