You are here

function restrict_by_ip_menu in Restrict Login or Role Access by IP Address 6

Same name and namespace in other branches
  1. 5 restrict_by_ip.module \restrict_by_ip_menu()
  2. 6.3 restrict_by_ip.module \restrict_by_ip_menu()
  3. 6.2 restrict_by_ip.module \restrict_by_ip_menu()
  4. 7.3 restrict_by_ip.module \restrict_by_ip_menu()

Implementation of hook_menu(). Add a menu item to the Administer >> Site building menu for displaying the restrict_by_ip.

File

./restrict_by_ip.module, line 26
Allows the admin to select which IP Addresses a user can login from for this site. Some of the code below is taken from the cck_ipaddress_module

Code

function restrict_by_ip_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/restrict_by_ip',
      'title' => t('Restrict by IP settings'),
      'description' => t('Limit the IP address a user is allowed to login from.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => 'restrict_by_ip_settings',
      'access' => user_access('administer site configuration') || user_access('administer restrict by ip'),
    );
  }
  return $items;
}