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.
string
Area that this Auth object will pertain to
authID() : string | false
string
false
authName() : string | false
string
false
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.
string
The username of the client to authenticate
string
string
The area that the client is to be authenticated within
boolean
True on success, False on failuregetActiveAuth() : object | false
object
false
getUser(string $container, string $id) : boolean
string
string
boolean
hasRight(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
boolean
isAuthenticated() : 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.
boolean
logOut()
usernameExists(string $username) : boolean
string
boolean
loadPermissions()
$activecontainer : null | object
$areaname : string
$authcontainers : array
$isauthenticated : boolean