You are here

function system_ip_blocking in Drupal 7

Menu callback. Display blocked IP addresses.

Parameters

$default_ip: Optional IP address to be passed on to drupal_get_form() for use as the default value of the IP address form field.

1 string reference to 'system_ip_blocking'
system_menu in modules/system/system.module
Implements hook_menu().

File

modules/system/system.admin.inc, line 1395
Admin page callbacks for the system module.

Code

function system_ip_blocking($default_ip = '') {
  $rows = array();
  $header = array(
    t('Blocked IP addresses'),
    t('Operations'),
  );
  $result = db_query('SELECT * FROM {blocked_ips}');
  foreach ($result as $ip) {
    $rows[] = array(
      $ip->ip,
      l(t('delete'), "admin/config/people/ip-blocking/delete/{$ip->iid}"),
    );
  }
  $build['system_ip_blocking_form'] = drupal_get_form('system_ip_blocking_form', $default_ip);
  $build['system_ip_blocking_table'] = array(
    '#theme' => 'table',
    '#header' => $header,
    '#rows' => $rows,
    '#empty' => t('No blocked IP addresses available.'),
  );
  return $build;
}