You are here

path2ban.module in path2ban 7.2

Same filename and directory in other branches
  1. 7 path2ban.module

File

path2ban.module
View source
<?php

/**
 * @file
 * path2ban module.
 */
module_load_include('inc', 'path2ban', 'includes/menu');
module_load_include('inc', 'path2ban', 'includes/settings');

/**
 * Implements hook_permission().
 */
function path2ban_permission() {
  $permissions = array();
  $permissions['administer path2ban'] = array(
    'title' => t('Administer path2ban'),
    'description' => t('Administer path2ban configuration settings.'),
  );
  $permissions['bypass path2ban'] = array(
    'title' => t('Bypass path2ban'),
    'description' => t('path2ban will not block this role.'),
  );
  return $permissions;
}

/**
 * Implements hook_mail().
 */
function path2ban_mail($key, &$message, $params) {
  $message['subject'] = $params['subject'];
  $message['body'] = $params['body'];
}

/**
 * Implements hook_page_build().
 *
 * In this module's current implementation too many Drupal libraries are needed
 * for a lower order hook to be used.
 */
function path2ban_page_build(&$page) {
  if (!variable_get('path2ban_use_hooks', 0)) {
    return;
  }
  Path2ban::destinationCheck();

  // No redirect needed, as it should just proceed to the 404 page.
}

Functions