You are here

protected function SFW::sfw_update_logs in Anti Spam by CleanTalk 8.3

1 call to SFW::sfw_update_logs()
SFW::check_ip in src/lib/Cleantalk/Antispam/SFW.php

File

src/lib/Cleantalk/Antispam/SFW.php, line 107

Class

SFW

Namespace

Drupal\cleantalk\lib\Cleantalk\Antispam

Code

protected function sfw_update_logs($ip, $desicion) {
  if ($ip === NULL || $desicion === NULL) {
    return;
  }
  $blocked = $desicion ? ' + 1' : '';
  $time = time();
  $query = "INSERT INTO " . $this->table_prefix . "cleantalk_sfw_logs\n\t\tSET \n\t\t\tip = '{$ip}',\n\t\t\tall_entries = 1,\n\t\t\tblocked_entries = 1,\n\t\t\tentries_timestamp = '" . intval($time) . "'\n\t\tON DUPLICATE KEY \n\t\tUPDATE \n\t\t\tall_entries = all_entries + 1,\n\t\t\tblocked_entries = blocked_entries" . strval($blocked) . ",\n\t\t\tentries_timestamp = '" . intval($time) . "'";
  $this
    ->universal_query($query);
}