function system_ip_blocking

system_ip_blocking($default_ip = '')

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.

File

modules/system/system.admin.inc, line 1394
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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.admin.inc/function/system_ip_blocking/7.x