You are here

public function SFW::actionsForPassed in Anti Spam by CleanTalk 8.4

Same name and namespace in other branches
  1. 9.1.x src/lib/Cleantalk/Common/Firewall/Modules/SFW.php \Cleantalk\Common\Firewall\Modules\SFW::actionsForPassed()

@inheritdoc

Overrides FirewallModule::actionsForPassed

File

src/lib/Cleantalk/Common/Firewall/Modules/SFW.php, line 174

Class

SFW

Namespace

Cleantalk\Common\Firewall\Modules

Code

public function actionsForPassed($result) {
  if ($this->set_cookies && !headers_sent()) {
    $status = $result['status'] === 'PASS_SFW__BY_WHITELIST' ? '1' : '0';
    $cookie_val = md5($result['ip'] . $this->api_key) . $status;
    CleantalkFuncs::apbct_setcookie('ct_sfw_pass_key', $cookie_val);
  }
}