Class: atkUrlVault
Source Location: /security/class.atkurlvault.inc
Class atkUrlVault
Class Overview
|
Vault for URLs
This class is a 'vault' where you can store urls, and check if a given url is in the vault. By adding all urls to the vault that are displayed on screen and checking the url on each request, you can guard an application against unauthorized url manipulation. The vault stores its state in the session, so it works across requests.
Located in /security/class.atkurlvault.inc [line 32]
Wiki documentation
Author(s):
Information Tags:
|
Properties
|
Methods
|
Property Summary
| array |
$m_vault |
The array containing all urls in the vault. |
Method Summary
| void |
addUrl() |
Add a URL to the vault. |
| int |
getSize() |
Get the size of the vault. |
| void |
setSize() |
Set the size of the vault. |
| void |
_purge() |
Remove superfluous URLS from the vault. |
Properties
The array containing all urls in the vault.
API Tags:
The maximum capacity of the vault.
API Tags:
Methods
Get an instance of the vault.
Constructor. Do not use directly, atkUrlVault is a singleton.
API Tags:
void addUrl(
String
$url
)
|
|
Add a URL to the vault.
If there are more URLS in the vault than its capacity, the oldest URLS are purged.
Parameters:
|
String |
$url: |
The url to add to the vault. |
True containsUrl(
String
$url
)
|
|
Check if an url is in the vault.
Parameters:
API Tags:
| Return: | if the url is in the vault. False if not. |
Get the size of the vault.
API Tags:
| Return: | The current capacity |
void setSize(
int
$size
)
|
|
Set the size of the vault.
The default size is 100. Note that if the vaultsize is decreased, any items in the vault that do not fit the new capacity are purged.
Parameters:
Remove superfluous URLS from the vault.
API Tags: