Bypass whitelisting if blacklisted
parent
528f4829af
commit
0a17b947d7
|
@ -145,6 +145,15 @@ class RateLimiter {
|
||||||
// Add to whitelist
|
// Add to whitelist
|
||||||
public function addToWhitelist($ip, $isNetwork = false, $description = '', $createdBy = 'system', $userId = null) {
|
public function addToWhitelist($ip, $isNetwork = false, $description = '', $createdBy = 'system', $userId = null) {
|
||||||
try {
|
try {
|
||||||
|
// Check if IP is blacklisted first
|
||||||
|
if ($this->isIpBlacklisted($ip)) {
|
||||||
|
$message = "Cannot whitelist {$ip} - IP is currently blacklisted";
|
||||||
|
if ($userId) {
|
||||||
|
$this->log->insertLog($userId, "IP Whitelist: {$message}", 'system');
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$stmt = $this->db->prepare("INSERT INTO {$this->whitelistTable}
|
$stmt = $this->db->prepare("INSERT INTO {$this->whitelistTable}
|
||||||
(ip_address, is_network, description, created_by)
|
(ip_address, is_network, description, created_by)
|
||||||
VALUES (?, ?, ?, ?)
|
VALUES (?, ?, ?, ?)
|
||||||
|
|
Loading…
Reference in New Issue