You are here

function _httpbl_cache_set in http:BL 5

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

Write status value into cache table

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

File

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

Code

function _httpbl_cache_set($ip, $status, $offset = 0) {
  db_query("DELETE FROM {httpbl} WHERE hostname = '%s'", $ip);
  db_query("INSERT INTO {httpbl} (hostname, status, expire) VALUES ('%s', %d, %d)", $ip, $status, time() + $offset);
}