Shieldon components are are sets of controller that allow you to add more custom rules to allow or deny before detecting user's behavior.
TrustedBot
TrustedBot component allows popular search engines to crawl your site without limit. please load this commponent at least .
Ip
Ip component allows you to set single IPs or IP ranges in the whitelist or the blacklist.
UserAgent
UserAgent component blocks well-known bad bots by default. You can add your list in UserAgent's blacklist.
Header
Header component blocks vistors without common header information in strict mode,
Rdns
Rdns component blocks vistors without Rdns recond or Rdns not match to IP address in strict mode.
$bool
)bool
$bool -
Set true to enble strict mode, false to disable it overwise.void
$component->setStrict(true);
$value
, $key
)string|array
$value -
The value of the data.string
$key -
The key of the data.void
Add an item to the blacklist pool.
Example:
$component->setDeniedItem($string);
$itemList
)array
$itemList -
String list.void
Add items to the blacklist pool.
Example:
$component->setDeniedItems($stringList);
$key
)string
$key -
The key of the data field.string|array
Get an item from the blacklist pool.
Example:
$item = $component->getDeniedItems('this_item');
array
Get the items from the blacklist pool.
$list = $component->getDeniedItems();
$key
)string
$key -
The key of the data.void
Remove a denied item if exists.
$component->removeDeniedItem($string);
void
Remove all denied items.
$component->removeDeniedItems();
$key
)string
$key -
The key of the data.bool
Check if a denied item exists.
Example:
if ($component->hasDeniedItem('test')) {
echo 'item exists';
} else {
echo 'item does not exist';
}
$key
)string
$key -
The key of the data.array
Check if denied items exist with the same prefix.
Example:
$deniedList = $component->getDenyWithPrefix('test');
$key
)string
$key -
The key of the data.void
Remove denied items with the same prefix.
$component->removeDenyWithPrefix('test');
bool
This method should adjust in extended class if need.
if ($component->isDenied()) {
echo 'This user has been denied.';
}
$value
, $key
)string|array
$value -
The value of the data.string
$key -
The key of the data.void
Add an item to the blacklist pool.
Example:
$component->setAllowedItem($string);
$itemList
)array
$itemList -
String list.void
Add items to the blacklist pool.
Example:
$component->setAllowedItems($stringList);
$key
)string
$key -
The key of the data field.string|array
Get an item from the blacklist pool.
Example:
$item = $component->getAllowedItems('this_item');
array
Get the items from the blacklist pool.
$list = $component->getAllowedItems();
$key
)string
$key -
The key of the data.void
Remove a allowed item if exists.
$component->removeAllowedItem($string);
void
Remove all allowed items.
$component->removeAllowedItems();
$key
)string
$key -
The key of the data.bool
Check if a allowed item exists.
Example:
if ($component->hasAllowedItem('test')) {
echo 'item exists';
} else {
echo 'item does not exist';
}
$key
)string
$key -
The key of the data.array
Check if a allowed item exists with the same prefix.
Example:
$allowedList = $component->getDenyWithPrefix('test');
$key
)string
$key -
The key of the data.void
Remove allowed items with the same prefix.
$component->removeDenyWithPrefix('test');
bool
This method should adjust in extended class if need.
if ($component->isAllowed()) {
echo 'This user has been allowed.';
}