Acts as a central Authorisation and permissions system for the script.
Some theory:
'Applications' are not directly supported as they are taken to mean
separate domains.
Areas track users having authenticated in different 'log in pages' within
the same domain, e.g. an Administrators area and a Members area and prevents
users with valid credentials in one area moving to a different area and having the
same 'AuthID' as someone in the second area, therefore gaining access.
AuthContainers are classes capable of authenticating a user (they should implement
AuthContainerInterface). They also need to be added to the database so
that they can be linked to Groups. The system can handle multiple
AuthContainers.
| package | dstruct_auth |
|---|
__construct(string $areaname)
If it has then isAuthenticated() will return true.
stringArea that this Auth object will pertain to
authID() : string | false
stringfalse
authName() : string | false
stringfalse
authenticate(string $username, string $password, string $areaname) : boolean
Calls authenticate() method of each AuthContainer until it finds a match. To authenticate, a user within the AuthContainers collection must have a valid username and password and belong to at least one group.
stringThe username of the client to authenticate
string
stringThe area that the client is to be authenticated within
booleanTrue on success, False on failuregetActiveAuth() : object | false
objectfalse
getUser(string $container, string $id) : boolean
string
string
booleanhasRight(string $rightname) : boolean
All rights are strings e.g. edit_gallery If a user has the right to 'edit the gallery' then true would be returned, otherwise false.
string
booleanisAuthenticated() : boolean
Authentication is stored in $_SESSION and is then validated against the AuthContainers and the Area to stop a user crossing over from one area to another by being authenticated on the first area but not the second.
booleanlogOut()
usernameExists(string $username) : boolean
string
booleanloadPermissions()
$activecontainer : null | object
$areaname : string
$authcontainers : array
$isauthenticated : boolean