-
Notifications
You must be signed in to change notification settings - Fork 35
icms_core_Security
Raimondas Rimkevičius edited this page Mar 9, 2020
·
1 revision
Notice: Wiki was automatic generated from project sources as project API documentation. Do not edit manually!
Class for managing security aspects such as checking referers, applying tokens and checking global variables for contamination
- Class name: icms_core_Security
- Namespace:
public mixed $errors = array()
- Visibility: public
mixed icms_core_Security::__construct()
Constructor
- Visibility: public
bool icms_core_Security::check(bool clearIfValid, string token, string name)
Check if there is a valid token in $_REQUEST[$name . '_REQUEST'] - can be expanded for more wide use, later (Mith)
- Visibility: public
- clearIfValid bool - <p>whether to clear the token after validation</p>
- token string - <p>token to validate</p>
- name string - <p>session name</p>
bool icms_core_Security::validateToken(string|bool token, bool clearIfValid, string name)
Check if a token is valid. If no token is specified, $_REQUEST[$name . '_REQUEST'] is checked
- Visibility: public
- token string|bool - <p>token to validate</p>
- clearIfValid bool - <p>whether to clear the token value if valid</p>
- name string - <p>session name to validate</p>
bool icms_core_Security::filterToken(string token)
Check whether a token value is expired or not
- Visibility: public
- token string
void icms_core_Security::garbageCollection(string name)
Perform garbage collection, clearing expired tokens
- Visibility: public
- name string - <p>session name</p>
string icms_core_Security::createToken(int timeout, string name)
Create a token in the user's session
- Visibility: public
- timeout int - <p>time in seconds the token should be valid</p>
- name string - <p>session name</p>
mixed icms_core_Security::clearTokens(string name)
Clear all token values from user's session
- Visibility: public
- name string - <p>session name</p>
bool icms_core_Security::checkReferer(int docheck)
Check the user agent's HTTP REFERER against ICMS_URL
- Visibility: public
- docheck int - <p>0 to not check the referer (used with XML-RPC), 1 to actively check it</p>
void icms_core_Security::checkSuperglobals()
Check superglobals for contamination
- Visibility: public
void icms_core_Security::checkBadips()
Check if visitor's IP address is banned
- Visibility: public
string icms_core_Security::getTokenHTML(string name)
Get the HTML code for a token
- Visibility: public
- name string - <p>Token field name</p>
array|string icms_core_Security::getErrors(bool ashtml)
Get generated errors
- Visibility: public
- ashtml bool - <p>Format using HTML?</p>
mixed icms_core_Security::setErrors(string error)
Add an error
- Visibility: public
- error string