You are here

function httpbl_request_whitelist_submit in http:BL 7

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

Grant the session whitelist.

File

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

Code

function httpbl_request_whitelist_submit($form, &$form_state) {
  $ip = ip_address();
  $iplink = _httpbl_ipdata($ip);
  if ($logs = variable_get('httpbl_log', HTTPBL_LOG_MIN)) {
    watchdog('httpbl', 'Session from %ip whitelisted. Reason for block: @reason', array(
      '%ip' => $ip,
      '@reason' => check_plain($form_state['values']['reason']),
    ), WATCHDOG_WARNING, $iplink);
  }
  drupal_set_message(t('The current session has been whitelisted.'), 'status', FALSE);
  $_SESSION['httpbl_status'] = 'white';

  //redirect form to original destination hidden in form
  drupal_goto($form_state['values']['arrival']);
}