Elgg  Version 3.0
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
ElggPAM Class Reference

Pluggable Authentication Module. More...

Public Member Functions

 __construct ($policy)
 constructor More...
 
 authenticate ($credentials=[])
 Authenticate a set of credentials against a policy This function will process all registered PAM handlers or stop when the first handler fails. More...
 
 getFailureMessage ()
 Get a failure message to display to user. More...
 

Static Public Attributes

static $_handlers = []
 

Protected Attributes

 $policy
 
 $messages
 

Detailed Description

Pluggable Authentication Module.

Definition at line 6 of file ElggPAM.php.

Constructor & Destructor Documentation

ElggPAM::__construct (   $policy)

constructor

Parameters
string$policyPAM policy type: user, api, or plugin-defined policies

Definition at line 30 of file ElggPAM.php.

Member Function Documentation

ElggPAM::authenticate (   $credentials = [])

Authenticate a set of credentials against a policy This function will process all registered PAM handlers or stop when the first handler fails.

A handler fails by either returning false or throwing an exception. The advantage of throwing an exception is that it returns a message that can be passed to the user. The processing order of the handlers is determined by the order that they were registered.

If $credentials are provided, the PAM handler should authenticate using the provided credentials. If not, then credentials should be prompted for or otherwise retrieved (eg from the HTTP header or $_SESSION).

Parameters
array$credentialsCredentials array dependant on policy type
Returns
bool

Definition at line 50 of file ElggPAM.php.

ElggPAM::getFailureMessage ( )

Get a failure message to display to user.

Returns
string

Definition at line 99 of file ElggPAM.php.

Member Data Documentation

ElggPAM::$_handlers = []
static

Definition at line 13 of file ElggPAM.php.

ElggPAM::$messages
protected

Definition at line 23 of file ElggPAM.php.

ElggPAM::$policy
protected

Definition at line 18 of file ElggPAM.php.


The documentation for this class was generated from the following file: