class JAuthentication extends JObservable


Located at : UKNOWVA_ROOT/libraries/joomla/user/authentication.php

Authenthication class, provides an interface for the Joomla authentication system

Constants

STATUS_SUCCESS

This is the status code returned when the authentication is success (permit login)

STATUS_CANCEL

Status to indicate cancellation of authentication (unused)

STATUS_FAILURE

This is the status code returned when the authentication failed (prevent login if no success)

STATUS_EXPIRED

This is the status code returned when the account has expired (prevent login)

STATUS_DENIED

This is the status code returned when the account has been denied (prevent login)

STATUS_UNKNOWN

This is the status code returned when the account doesn't exist (not an error)

Methods

__construct()

Constructor

string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
mixed
getState()

Get the state of the JObservable object

array
notify()

Update each attached observer object and return an array of their return values

void
attach(object $observer)

Attach an observer object

bool
detach(object $observer)

Detach an observer object

static JAuthentication
getInstance()

Returns the global authentication object, only creating it if it doesn't already exist.

authenticate(array $credentials, array $options = array())

Finds out if a set of login credentials are valid by asking all obvserving objects to run their respective authentication routines.

static Array[JAuthenticationResponse]
authorise(JAuthenticationResponse $response, Array $options = array())

Authorises that a particular user should be able to login

Details

at line 95
JObject __construct()

Constructor

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

in JObservable at line 61
mixed getState()

Get the state of the JObservable object

Return Value

mixed The state of the object.

in JObservable at line 72
array notify()

Update each attached observer object and return an array of their return values

Return Value

array Array of return values from the observers

in JObservable at line 91
void attach(object $observer)

Attach an observer object

Parameters

object $observer An observer object to attach

Return Value

void

in JObservable at line 152
bool detach(object $observer)

Detach an observer object

Parameters

object $observer An observer object to detach.

Return Value

bool True if the observer object was detached.

at line 112
static JAuthentication getInstance()

Returns the global authentication object, only creating it if it doesn't already exist.

Return Value

JAuthentication The global JAuthentication object

at line 139
JAuthenticationResponse authenticate(array $credentials, array $options = array())

Finds out if a set of login credentials are valid by asking all obvserving objects to run their respective authentication routines.

Parameters

array $credentials Array holding the user credentials
array $options Array holding user options

Return Value

JAuthenticationResponse Response object with status variable filled in for last plugin or first successful plugin

See also

JAuthenticationResponse

at line 206
static Array[JAuthenticationResponse] authorise(JAuthenticationResponse $response, Array $options = array())

Authorises that a particular user should be able to login

Parameters

JAuthenticationResponse $response username of the user to authorise
Array $options list of options

Return Value

Array[JAuthenticationResponse] results of authorisation