Public Member Functions | |
| getUserFromCryptic ($cryptic) | |
| isLogged () | |
| getUser () | |
| setUser (db_row $user, $saveLogin=true) | |
| login ($prm=null, $page=null, $redirectIfLogged=true) | |
| logFromCryptic ($cryptic) | |
| cryptPass ($str, $plus='Password') | |
| logout ($prm=null) | |
| addRole ($role) | |
| hasRole ($role=null) | |
| delRole ($role=null) | |
| check (array $url=null, $redirect=true) | |
| getLoginForm (array $prm=array()) | |
| getSession () | |
| login ($prm=null, $page=null) | |
| protect ($page=null) | |
| getPage ($type='login', $uri=false) | |
| getAttr ($name) | |
| setAttr ($name, $value) | |
| getCfg () | |
Protected Member Functions | |
| afterInit () | |
| autoLogin () | |
| saveLogin () | |
| hook ($name) | |
| isContained (array $url, array $checks) | |
| beforeInit () | |
Protected Attributes | |
| $session | |
| $table | |
| $user | |
| $form | |
| $logged = false | |
| $roles = array() | |
| $cfg | |
Security class to check user rights. By default, allowing everything to the logged users
Definition at line 11 of file default.class.php.
| addRole | ( | $ | role | ) |
Add a role to the current user
| mixed | $role |
Reimplemented from security_abstract.
Definition at line 227 of file default.class.php.
| afterInit | ( | ) | [protected] |
Call just after the configuration initialisation
Reimplemented from security_abstract.
Definition at line 55 of file default.class.php.
| autoLogin | ( | ) | [protected] |
Autologin the user with session vars or an eventual cookie
Definition at line 67 of file default.class.php.
| beforeInit | ( | ) | [protected, inherited] |
Call just before the configuration initialisation
Reimplemented in form_file.
Definition at line 35 of file object.class.php.
| check | ( | array $ | url = null, |
|
| $ | redirect = true | |||
| ) |
Check if the user can access to the url given in the array (request style) or the current URL if null is given
| null|array | $url | |
| bool | $redirect Indicate if the user should be directly redirected and exit the program |
Reimplemented from security_abstract.
Definition at line 248 of file default.class.php.
| cryptPass | ( | $ | str, | |
| $ | plus = 'Password' | |||
| ) |
Crypt a string with the function configured
| string | $str The string to crypt | |
| null|string | $plus If need to used the second crypt function (or other configured) |
Definition at line 208 of file default.class.php.
| delRole | ( | $ | role = null |
) |
Delete a role or all roles
| null|mixed | $role null to delete all roles |
Reimplemented from security_abstract.
Definition at line 239 of file default.class.php.
| getAttr | ( | $ | name | ) | [inherited] |
Get an attribute
| string | $name Attribute name |
Reimplemented in response_proxy.
Definition at line 48 of file object.class.php.
| getCfg | ( | ) | [inherited] |
| getLoginForm | ( | array $ | prm = array() |
) |
Get the login Form Object
Reimplemented from security_abstract.
Definition at line 290 of file default.class.php.
| getPage | ( | $ | type = 'login', |
|
| $ | uri = false | |||
| ) | [inherited] |
Get a configured page
| string | $type Pagename (login, logged, logout, forbidden) | |
| bool | $uri Indiciate if the url should be parsed with request::uri to be used directly |
Definition at line 101 of file security/abstract.class.php.
| getSession | ( | ) |
Return the session object used for security
Definition at line 320 of file default.class.php.
| getUser | ( | ) |
| getUserFromCryptic | ( | $ | cryptic | ) |
Get a DB user from it's cryptic
| string | $cryptic Cryptic |
Definition at line 93 of file default.class.php.
| hasRole | ( | $ | role = null |
) |
Check if the current user has a specific role or retrun the whole roles
| null|mixed | $role null to get all roles |
Reimplemented from security_abstract.
Definition at line 232 of file default.class.php.
| hook | ( | $ | name | ) | [protected, inherited] |
Function to be rewritten in eventual child to change the way security works Available actions:
| string | $action |
Definition at line 117 of file security/abstract.class.php.
| isContained | ( | array $ | url, | |
| array $ | checks | |||
| ) | [protected, inherited] |
Indicate if a configuration array is contained in the url
| array | $url | |
| array | $checks |
Definition at line 126 of file security/abstract.class.php.
| isLogged | ( | ) |
Check if the user is logged
Reimplemented from security_abstract.
Definition at line 99 of file default.class.php.
| logFromCryptic | ( | $ | cryptic | ) |
Log a session user using his cryptic
| string | $cryptic |
Definition at line 196 of file default.class.php.
| login | ( | $ | prm = null, |
|
| $ | page = null, |
|||
| $ | redirectIfLogged = true | |||
| ) |
Login the current user
| mixed | $prm | |
| null|string | $page The page where to be redirected. If null, config will be used | |
| boolean | $redirectIfLogged Enable the redirect when login is successful |
Definition at line 146 of file default.class.php.
| login | ( | $ | prm = null, |
|
| $ | page = null | |||
| ) | [abstract, inherited] |
Login the current user
| mixed | $prm | |
| null|string | $page The page where to be redirected. If null, config will be used |
Reimplemented in security_public.
| logout | ( | $ | prm = null |
) |
Logout the current user
| mixed | $prm |
Reimplemented from security_abstract.
Definition at line 215 of file default.class.php.
| protect | ( | $ | page = null |
) | [inherited] |
Redirect the user if not logged
| null|string | $page Page to redirect or configured page forbidden if not provided |
Definition at line 88 of file security/abstract.class.php.
| saveLogin | ( | ) | [protected] |
Save the login. Set a new cryptic, save the DB user and save it in session.
Definition at line 130 of file default.class.php.
| setAttr | ( | $ | name, | |
| $ | value | |||
| ) | [inherited] |
Set an attribute
| string | $name Attribute name | |
| mixed | $value Attribute value |
Reimplemented in response_proxy.
Definition at line 58 of file object.class.php.
| setUser | ( | db_row $ | user, | |
| $ | saveLogin = true | |||
| ) |
Set the logged user
| db_row | $user | |
| boolean | $saveLogin Indicates if the session should be saved |
Definition at line 120 of file default.class.php.
$cfg [protected, inherited] |
Definition at line 17 of file object.class.php.
$form [protected] |
Definition at line 39 of file default.class.php.
$logged = false [protected] |
Definition at line 46 of file default.class.php.
$roles = array() [protected] |
Definition at line 53 of file default.class.php.
$session [protected] |
Definition at line 18 of file default.class.php.
$table [protected] |
Definition at line 25 of file default.class.php.
$user [protected] |
Definition at line 32 of file default.class.php.
1.7.1