You are here

private function Firewall::isWhitelisted in Anti Spam by CleanTalk 8.4

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

Check the result if it whitelisted or trusted network

Parameters

array $results:

Return value

bool

1 call to Firewall::isWhitelisted()
Firewall::run in src/lib/Cleantalk/Common/Firewall/Firewall.php
Do main logic of the module.

File

src/lib/Cleantalk/Common/Firewall/Firewall.php, line 265

Class

Firewall

Namespace

Cleantalk\Common\Firewall

Code

private function isWhitelisted($results) {
  global $apbct;
  foreach ($this->fw_modules as $module) {
    if (array_key_exists($module->module_name, $results)) {
      foreach ($results[$module->module_name] as $fw_result) {
        if (strpos($fw_result['status'], 'PASS_BY_TRUSTED_NETWORK') !== false || strpos($fw_result['status'], 'PASS_BY_WHITELIST') !== false || strpos($fw_result['status'], 'PASS_SFW__BY_WHITELIST') !== false) {
          return true;
        }
      }
    }
  }
  return false;
}