You are here

function httpbl_page_bottom in http:BL 8

Implements hook_page_bottom().

File

./httpbl.module, line 424
Implements Project Honeypot's http:BL for Drupal. It provides IP-based blacklisting through http:BL and allows linking to a honeypot.

Code

function httpbl_page_bottom(array &$page_bottom) {

  // Check settings to see if page bottom honeypots enabled.
  if (\Drupal::state()
    ->get('httpbl.footer') ?: FALSE) {
    $link = \Drupal::state()
      ->get('httpbl.link') ?: NULL;
    $word = \Drupal::state()
      ->get('httpbl.word') ?: 'randomness';
    $honeypot = HttpblResponse::httpbl_honeylink($link, $word);
    if (!empty($honeypot)) {
      $page_bottom['httpbl'] = array(
        '#type' => 'markup',
        '#markup' => $honeypot,
      );
    }
  }
}