get_id()
Returns the drivers unique id. This can be used to identify the driver, or to select a specific driver instance.
Static | No |
---|---|
Parameters | None |
Returns | The drivers id string. |
Example |
|
The Auth package provides a standardized interface for authentication in Fuel. This allows our users to write their own drivers and easily integrate a new driver to work with old code by keeping the basic methods consistent.
This driver is the base class for all Auth group drivers. It is defined as an abstract class which contains all methods generic to all group drivers, and abstract method definitions for all methods any group driver MUST implement.
A group driver can load additional drivers that it depends on. Generally, these are ACL drivers. But your implementation could introduce and use custom driver types as well. To do so, add this structure to your driver class:
// autoload the Simpleacl acl driver when loading this group driver
protected $config = array(
'drivers' => array('acl' => array('Simpleacl'))
);
For ease of use, the member() method is exposed through the generic Auth static interface.
Using the static interface, you can do
// returns true if the current user is member of group 16.
$is_member = Auth::member(16);
Generic methods are defined in the group base driver, and are available to all Auth group drivers through extension. These methods provide functions to interact with groups, and to check for access.
The methods defined in the classes but not documented here are used internally, and should not be called directly.
Returns the drivers unique id. This can be used to identify the driver, or to select a specific driver instance.
Static | No |
---|---|
Parameters | None |
Returns | The drivers id string. |
Example |
|
Sets a driver configuration value.
Static | No | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | void | |||||||||
Example |
|
Gets a driver configuration value.
Static | No | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | mixed | |||||||||
Example |
|
Every group driver you develop MUST provide all of these methods, and the MUST return the values documented here.
Checks if user is a member of the given group in either all loaded Group drivers or just those specified as the 2nd parameter.
Static | Yes | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | bool, whether one of the (given) drivers had the current user registered as a member | |||||||||
Example |
|
Get the display name of the given group name.
Static | Yes | ||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns | mixed, the retrieved group display name, or false if the given group does not exist. | ||||||
Example |
|