Add config variable to set ban type

develop
Steve Allison 2013-02-20 21:20:42 +00:00
parent 2e7c4825ff
commit 24b87fa579
2 changed files with 8 additions and 0 deletions

View File

@ -40,6 +40,13 @@
// Default ban period // Default ban period
$rcmail_config['defense_ban_period'] = 120; $rcmail_config['defense_ban_period'] = 120;
/* Ban with HTTP status
* If set to true: Banned IPs are treated as blacklisted, and will receive
* a HTTP 403 Forbidden response instead of a login screen
* If set to false (default): Banned IPs receive login screen with red warning
* showing duration of ban remaining */
$rcmail_config['defense_ban_httpstatus'] = false;
// Repeated offenders have their banperiod multiplied, set to 1 to not multiply // Repeated offenders have their banperiod multiplied, set to 1 to not multiply
$rcmail_config['defense_repeat_multiplier'] = 4; $rcmail_config['defense_repeat_multiplier'] = 4;

View File

@ -76,6 +76,7 @@ class defense extends rcube_plugin {
$this->fail_max = $this->rc->config->get('defense_fail_max', 5); $this->fail_max = $this->rc->config->get('defense_fail_max', 5);
$this->fail_reset = $this->rc->config->get('defense_fail_reset', 600); $this->fail_reset = $this->rc->config->get('defense_fail_reset', 600);
$this->ban_period = $this->rc->config->get('defense_ban_period', 120); $this->ban_period = $this->rc->config->get('defense_ban_period', 120);
$this->ban_httpstatus = $this->rc->config->get('defense_ban_httpstatus', false);
$this->repeat_multiplier = $this->rc->config->get('defense_repeat_multiplier', 4); $this->repeat_multiplier = $this->rc->config->get('defense_repeat_multiplier', 4);
$this->repeat_reset = $this->rc->config->get('defense_repeat_reset', 86400); $this->repeat_reset = $this->rc->config->get('defense_repeat_reset', 86400);
$this->db_table = $this->rc->config->get('defense_db_table', 'defense'); $this->db_table = $this->rc->config->get('defense_db_table', 'defense');