| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) exit; |
| 4 |
if (!class_exists('BVWPLPConfig')) : |
| 5 |
class BVWPLPConfig { |
| 6 |
public $mode; |
| 7 |
public $captchaLimit; |
| 8 |
public $tempBlockLimit; |
| 9 |
public $blockAllLimit; |
| 10 |
public $failedLoginGap; |
| 11 |
public $successLoginGap; |
| 12 |
public $allBlockedGap; |
| 13 |
|
| 14 |
public static $requests_table = 'lp_requests'; |
| 15 |
|
| 16 |
#mode |
| 17 |
const DISABLED = 1; |
| 18 |
const AUDIT = 2; |
| 19 |
const PROTECT = 3; |
| 20 |
|
| 21 |
public function __construct($confHash) { |
| 22 |
$this->mode = array_key_exists('mode', $confHash) ? intval($confHash['mode']) : BVWPLPConfig::DISABLED; |
| 23 |
$this->captchaLimit = array_key_exists('captchalimit', $confHash) ? intval($confHash['captchalimit']) : 3; |
| 24 |
$this->tempBlockLimit = array_key_exists('tempblocklimit', $confHash) ? intval($confHash['tempblocklimit']) : 10; |
| 25 |
$this->blockAllLimit = array_key_exists('blockalllimit', $confHash) ? intval($confHash['blockalllimit']) : 100; |
| 26 |
$this->failedLoginGap = array_key_exists('failedlogingap', $confHash) ? intval($confHash['failedlogingap']) : 1800; |
| 27 |
$this->successLoginGap = array_key_exists('successlogingap', $confHash) ? intval($confHash['successlogingap']) : 1800; |
| 28 |
$this->allBlockedGap = array_key_exists('allblockedgap', $confHash) ? intval($confHash['allblockedgap']) : 1800; |
| 29 |
} |
| 30 |
} |
| 31 |
endif; |