You are here

public function CleanTalkSFW::sfw_die in Anti Spam by CleanTalk 7.2

Same name and namespace in other branches
  1. 7.5 src/CleantalkSFW.php \CleantalkSFW::sfw_die()
  2. 7.4 src/CleantalkSFW.php \CleantalkSFW::sfw_die()

File

./cleantalk.module, line 92
Main CleanTalk integration module functions.

Class

CleanTalkSFW
Cleantalk Spam FireWall class

Code

public function sfw_die() {
  $key = variable_get('cleantalk_authkey', '');
  $sfw_die_page = file_get_contents(dirname(__FILE__) . "/sfw_die_page.html");
  $sfw_die_page = str_replace("{REMOTE_ADDRESS}", $this->blocked_ip, $sfw_die_page);
  $sfw_die_page = str_replace("{REQUEST_URI}", $_SERVER['REQUEST_URI'], $sfw_die_page);
  $sfw_die_page = str_replace("{SFW_COOKIE}", md5($this->blocked_ip . $key), $sfw_die_page);
  @setcookie('ct_sfw_passed', '0');
  @header('HTTP/1.0 403 Forbidden');
  print $sfw_die_page;
  die;
}