You are here

function session_limit_menu in Session Limit 6

Same name and namespace in other branches
  1. 5 session_limit.module \session_limit_menu()
  2. 6.2 session_limit.module \session_limit_menu()
  3. 7.2 session_limit.module \session_limit_menu()

Implementation of hook_menu().

File

./session_limit.module, line 40
Limits multiple sessions per user.

Code

function session_limit_menu() {
  $items['session/limit'] = array(
    'title' => 'Session limit exceeded',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_page',
    ),
    'access callback' => 'user_is_logged_in',
    'type' => MENU_CALLBACK,
  );
  $items['mysessions'] = array(
    'title' => 'My sessions',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_page',
    ),
    'access callback' => 'user_is_logged_in',
    'type' => MENU_SUGGESTED_ITEM,
  );
  $items['admin/user/session_limit'] = array(
    'title' => 'Session limit',
    'description' => 'Configure session limits.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_settings',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_NORMAL_ITEM,
  );
  $items['admin/user/session_limit/defaults'] = array(
    'title' => 'Defaults',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_settings',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer site configuration',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
  );
  $items['admin/user/session_limit/roles'] = array(
    'title' => 'Role limits',
    'description' => 'Configure session limits by role.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_settings_byrole',
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer session limits by role',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  $items['user/%user/session_limit'] = array(
    'title' => 'Session limit',
    'description' => 'Configure session limit for one user.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'session_limit_user_settings',
      1,
    ),
    'access callback' => 'user_access',
    'access arguments' => array(
      'administer session limits per user',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}