To be compatible with the auth package, containers must impliment this interface.

Any potential AuthContainer must impliment the methods of this interface (they don't have to impliment the interface explicitly though!).

package dstruct_auth

 Methods

Attempt to authenticate the user.

authenticate(string $username, string $password) : boolean

The operation of the authenticate method is entirely up to the implimenting class. This allows the container to integrate and authenticate with whatever system you choose. The class must return a boolean with true as a successfull authentication.

see \Perm::authenticate()

Parameters

$username

string

$password

string

Returns

boolean

A user friendly name for the Container.

getDisplayName(boolean $raw) : string

If $raw is false then the return should be encoded to be output as html.

Parameters

$raw

boolean

Returns

string

Must return Object Collection of {@link Groups}.

getGroups() : object

Returns

object

Must return a unique and persistant ID

getID() : string

Returns

string

Must return true or false, dependant on the container belonging to any clpGroups.

hasGroups() : boolean

Returns

boolean

Must return an object of the type the AuthContainer represents.

loadByID(string $id) : object
Static

Parameters

$id

string

Returns

object

Returns the array of current permissions.

permissions() : array
see \Perm::permissions()

Returns

array

Tests whether a record with the same username already exists.

usernameExists(string $username) : boolean
Static

This kind of call would usually be made on the Object Collection class,, but the auth package gets no knowledge of these collections so must make the call to the implimenting class which will usually pass the call on to the collection.

Parameters

$username

string

Returns

boolean