' . t('About') . ''; $output .= '
' . t('The Ban module allows administrators to ban visits to their site from individual IP addresses.') . '
'; $output .= '' . t('IP addresses listed here are banned from your site. Banned addresses are completely forbidden from accessing the site and instead see a brief message explaining the situation.') . '
'; } } /** * Implements hook_permission(). */ function ban_permission() { return array( 'ban IP addresses' => array( 'title' => t('Ban IP addresses'), ), ); } /** * Implements hook_menu(). */ function ban_menu() { $items['admin/config/people/ban'] = array( 'title' => 'IP address bans', 'description' => 'Manage banned IP addresses.', 'page callback' => 'ban_admin_page', 'access arguments' => array('ban IP addresses'), 'file' => 'ban.admin.inc', 'weight' => 10, ); $items['admin/config/people/ban/delete/%ban_ip'] = array( 'title' => 'Delete IP address', 'page callback' => 'drupal_get_form', 'page arguments' => array('ban_ip_delete_form', 5), 'access arguments' => array('ban IP addresses'), 'file' => 'ban.admin.inc', ); return $items; } /** * Loads a banned IP address record from the database. * * @param int $iid * The ID of the banned IP address to retrieve. * * @return array * The banned IP address record from the database as an array. */ function ban_ip_load($iid) { return db_query("SELECT * FROM {ban_ip} WHERE iid = :iid", array(':iid' => $iid))->fetchAssoc(); }