You are here

function _httpbl_cache_get in http:BL 5

Same name and namespace in other branches
  1. 6.2 httpbl.module \_httpbl_cache_get()
  2. 6 httpbl.module \_httpbl_cache_get()
  3. 7 httpbl.module \_httpbl_cache_get()

Get status value from cache table

1 call to _httpbl_cache_get()
httpbl_blacklisted in ./httpbl.module
Check if an IP should be banned

File

./httpbl.module, line 696
Implementation of http:BL for Drupal. It provides IP-based blacklisting through http:BL and allows linking to a honeypot.

Code

function _httpbl_cache_get($ip) {
  $result = db_result(db_query("SELECT status FROM {httpbl} WHERE hostname = '%s'", $ip));
  if ($result === '1') {
    return TRUE;
  }
  else {
    if ($result === '0') {
      return FALSE;
    }
    else {
      if ($result === '2') {
        return 2;
      }
    }
  }
}