You are here

public function AntiFlood::update_ac_log in Anti Spam by CleanTalk 9.1.x

Same name and namespace in other branches
  1. 8.4 src/lib/Cleantalk/Common/Firewall/Modules/AntiFlood.php \Cleantalk\Common\Firewall\Modules\AntiFlood::update_ac_log()

Update ac logs table

1 call to AntiFlood::update_ac_log()
AntiFlood::check in src/lib/Cleantalk/Common/Firewall/Modules/AntiFlood.php
Use this method to execute main logic of the module.

File

src/lib/Cleantalk/Common/Firewall/Modules/AntiFlood.php, line 189

Class

AntiFlood

Namespace

Cleantalk\Common\Firewall\Modules

Code

public function update_ac_log() {
  $interval_time = Helper::time__get_interval_start($this->store_interval);
  foreach ($this->ip_array as $current_ip) {
    $id = md5($current_ip . $this->sign . $interval_time);
    $this->db
      ->execute("INSERT INTO " . $this->db__table__ac_logs . " SET\n\t\t\t\t\tid = '{$id}',\n\t\t\t\t\tip = '{$current_ip}',\n\t\t\t\t\tua = '{$this->sign}',\n\t\t\t\t\tentries = 1,\n\t\t\t\t\tinterval_start = {$interval_time}\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\tip = ip,\n\t\t\t\t\tentries = entries + 1,\n\t\t\t\t\tinterval_start = {$interval_time};");
  }
}