Security class to check user rights
Definition at line 10 of file security/abstract.class.php.
◆ addRole()
Add a role to the current user
- Parameters
-
- Returns
- bool True if successful
◆ afterInit()
◆ beforeInit()
Call just before the configuration initialisation
Definition at line 35 of file object.class.php.
◆ check()
check |
( |
array |
$url = null , |
|
|
|
$redirect = true |
|
) |
| |
|
abstract |
Check if the user can access to the url given in the array (request style) or the current URL if null is given
- Parameters
-
null | array | $url | |
bool | $redirect | Indicate if the user should be directly redirected and exit the program |
- Returns
- bool True if authorized access
◆ delRole()
Delete a role or all roles
- Parameters
-
null | mixed | $role | null to delete all roles |
- Returns
- bool True if successful
◆ getAttr()
Get an attribute
- Parameters
-
string | $name | Attribute name |
- Returns
- mixed|null The attribute or null if not set
Definition at line 48 of file object.class.php.
◆ getCfg()
Get the configuration object
- Returns
- config
Definition at line 67 of file object.class.php.
◆ getLoginForm()
getLoginForm |
( |
array |
$prm = array() | ) |
|
|
abstract |
Get the login Form Object
- Returns
- form
◆ getPage()
Get a configured page
- Parameters
-
string | $type | Pagename (login, logged, logout, forbidden) |
bool | $uri | Indiciate if the url should be parsed with request::uri to be used directly |
- Returns
- string The page url
Definition at line 101 of file security/abstract.class.php.
◆ hasRole()
Check if the current user has a specific role or retrun the whole roles
- Parameters
-
null | mixed | $role | null to get all roles |
- Returns
- array|bool Array of roles or bool
◆ hook()
Function to be rewritten in eventual child to change the way security works Available actions:
- autoLogin
- autoLoginSession
- login
- redirectError
- logout
- Parameters
-
Definition at line 117 of file security/abstract.class.php.
◆ isContained()
isContained |
( |
array |
$url, |
|
|
array |
$checks |
|
) |
| |
|
protected |
Indicate if a configuration array is contained in the url
- Parameters
-
- Returns
- bool True if a line in $checks matches the $url
Definition at line 126 of file security/abstract.class.php.
◆ isLogged()
Check if the user is logged
- Returns
- bool
◆ login()
login |
( |
|
$prm = null , |
|
|
|
$page = null |
|
) |
| |
|
abstract |
Login the current user
- Parameters
-
mixed | $prm | |
null | string | $page | The page where to be redirected. If null, config will be used |
- Returns
- bool True if successful
◆ logout()
Logout the current user
- Parameters
-
- Returns
- bool True if successful
◆ protect()
Redirect the user if not logged
- Parameters
-
null | string | $page | Page to redirect or configured page forbidden if not provided |
- Returns
- true|void True if allowed, will be redirected if not
Definition at line 88 of file security/abstract.class.php.
◆ setAttr()
setAttr |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
Set an attribute
- Parameters
-
string | $name | Attribute name |
mixed | $value | Attribute value |
Definition at line 58 of file object.class.php.
◆ $cfg
The documentation for this class was generated from the following file: