You are here

function ip_ranges_page in IP Ranges 7

Same name and namespace in other branches
  1. 7.2 ip_ranges.admin.inc \ip_ranges_page()

Menu callback. Displays banned IP ranges.

1 string reference to 'ip_ranges_page'
ip_ranges_menu in ./ip_ranges.module
Implements hook_menu().

File

./ip_ranges.admin.inc, line 11
Page callback file for the ip ranges module.

Code

function ip_ranges_page() {
  $rows = array();
  $header = array(
    t('banned IP addresses'),
    t('list type'),
    t('Operations'),
  );
  $ip_list = ip_ranges_get_ip_list();
  foreach ($ip_list as $ip) {
    $rows[] = array(
      str_replace('-', ' - ', $ip->ip),
      $ip->type,
      l(t('delete'), "admin/config/people/ip-ranges/delete/{$ip->bid}/{$ip->ip}"),
    );
  }
  $build['ip_ranges_form'] = drupal_get_form('ip_ranges_form');
  $build['ip_ranges_banning_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
  );
  return $build;
}