dnsbl_antispam_plugin dnsbl_antispam_plugin(
)
|
|
Constructor
void AdminAfterMenuInit(
)
|
|
Register a tools tab.
Redefinition of:
- Plugin::AdminAfterMenuInit()
- Event handler: Gets invoked in /admin/_header.php for every backoffice page after the menu structure is build. You could use the $AdminUI object to modify it.
Method that gets invoked when we're selected in the tools menu.
Catch params and do actions.
Redefinition of:
- Plugin::AdminTabAction()
- Event handler: Method that gets invoked when our tab is selected.
Display our tool tab with query action and statistics if enabled.
Redefinition of:
- Plugin::AdminTabPayload()
- Event handler: Gets invoked when our tab is selected and should get displayed.
Check dependency on Captcha plugin, add note in case it's missing and disable the setting.
Redefinition of:
- Plugin::AfterInstall()
- Event handler: Called after the plugin has been installed.
void AppendPluginRegister(
)
|
|
Get $use_whitelisting property, if not set before (e.g. in Install()).
Redefinition of:
- Plugin::AppendPluginRegister()
- Event handler: Called at the event of registering/instantiating the Plugin (in Plugins::register()).
false|string check_dnsbl_ip(
$ip,
$blacklist
)
|
|
Check a given IP on a given blacklist.
Parameters:
API Tags:
| Return: | false if not listed, the resulting string otherwise. |
void display_error_page(
string
$error_ip_blocked
)
|
|
Display error page that may allow whitelisting the Session.
Parameters:
|
string |
$error_ip_blocked: |
Additional error message. |
void FilterIpAddress(
&$params
)
|
|
We wrap IP addresses with a link that points to the IP (with "http://" prefixed) and provide an onclick event to query the address through the browser.
Parameters:
Redefinition of:
- Plugin::FilterIpAddress()
- Event handler: Called when an IP address gets displayed, typically in a protected area or for a privileged user, e.g. in the backoffice statistics menu.
A table for logging statistics.
Redefinition of:
- Plugin::GetDbLayout()
- This method should return your DB schema, consisting of a list of CREATE TABLE queries.
array GetDefaultSettings(
)
|
|
Get the default settings of the plugin.
Redefinition of:
- Plugin::GetDefaultSettings()
- Define here default settings that are then available in the backoffice.
false|string|array is_listed(
string
$ip, [boolean
$check_all = false]
)
|
|
Check if an IP is blacklisted.
Parameters:
|
string |
$ip: |
IP address / host name |
|
boolean |
$check_all: |
Check all given lists, or return error on first match? |
API Tags:
| Return: | false: IP is ok string: The value of the lookup when blacklisted ("blacklist: reason") array: of strings if $check_all |
void PluginSettingsValidateSet(
&$params
)
|
|
Check "use_whitelisting" activation.
Parameters:
Redefinition of:
- Plugin::PluginSettingsValidateSet()
- Event handler: Called before displaying or setting a plugin's setting in the backoffice.
Plugin's main action hook.
It checks if the remote IP is in the list of DNS Blacklists and dies with an error page then, allowing the user to whitelist her/himself for the session if a plugin is installed for it.
Redefinition of:
- Plugin::SessionLoaded()
- Event handler: Called after initializing plugins, DB, Settings, Hit, .. but quite early.
boolean update_stats(
string
$type, [
$data = NULL], [
$doit = false]
)
|
|
Update our statistics.
We call ourself here as shutdown_function because we want $Hit::ID.
Parameters:
|
string |
$type: |
Type ('blocked', 'not_blocked', 'whitelisted') |
|
|
$data: |
|
|
|
$doit: |
|
string|true validate_my_deps(
)
|
|
Internal method to check dependencies on Captcha plugin.