You are here

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

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 restrict_by_ip.module \restrict_by_ip_menu()
  4. 6.2 restrict_by_ip.module \restrict_by_ip_menu()

Implementation of hook_menu().

File

./restrict_by_ip.module, line 26
Allows the admin to select which ip addresses role or 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() {
  $items = array();
  $items['admin/config/people/restrict_by_ip'] = array(
    'title' => t('Restrict by IP'),
    'description' => t('General settings for Restrict by IP module.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'restrict_by_ip_general_settings',
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
  );
  $items['admin/config/people/restrict_by_ip/general'] = array(
    'title' => t('General settings'),
    'description' => t('General settings for Restrict by IP module.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'restrict_by_ip_general_settings',
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/config/people/restrict_by_ip/login'] = array(
    'title' => t('Restrict login by IP'),
    'description' => t('Limit the IP address a user is allowed to login from.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'restrict_by_ip_login_settings',
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['admin/config/people/restrict_by_ip/login/add'] = array(
    'title' => t('Add new login IP restriction'),
    'description' => t('Add a new IP restriction to a user.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'restrict_by_ip_login_add_edit_user',
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/people/restrict_by_ip/login/edit/%user'] = array(
    'title' => t('Edit existing login IP restriction'),
    'description' => t('Edit an existing IP restriction for a user.'),
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'restrict_by_ip_login_add_edit_user',
      6,
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/config/people/restrict_by_ip/role'] = array(
    'title' => t('Restrict role by IP'),
    'description' => t('Limit the IP address range roles may accessed from.'),
    'page callback' => t('drupal_get_form'),
    'page arguments' => array(
      'restrict_by_ip_role_settings',
    ),
    'access arguments' => array(
      'administer restrict by ip',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}