You are here

function cas_menu in CAS 5

Same name and namespace in other branches
  1. 5.4 cas.module \cas_menu()
  2. 5.3 cas.module \cas_menu()
  3. 6.3 cas.module \cas_menu()
  4. 6 cas.module \cas_menu()
  5. 6.2 cas.module \cas_menu()
  6. 7 cas.module \cas_menu()

Implements hook_menu.

File

./cas.module, line 274

Code

function cas_menu($may_cache) {
  global $user;
  $items = array();
  cas_login_check();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/user/cas',
      'title' => t('CAS settings'),
      'description' => 'Configure central authentication services',
      'callback' => 'drupal_get_form',
      'callback arguments' => 'cas_admin_settings',
      'access' => user_access('administer cas'),
      'type' => MENU_NORMAL_ITEM,
    );
    if (!$user->uid || arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'menu') {
      $items[] = array(
        'path' => 'cas',
        'title' => t('CAS Login'),
        'callback' => 'cas_login_page',
        'access' => TRUE,
        'type' => MENU_SUGGESTED_ITEM,
      );
    }
    if ($user->uid || arg(0) == 'admin' && arg(1) == 'build' && arg(2) == 'menu') {
      $items[] = array(
        'path' => 'caslogout',
        'title' => t('CAS Logout'),
        'callback' => 'cas_logout',
        'access' => TRUE,
        'type' => MENU_SUGGESTED_ITEM,
      );
    }
  }
  return $items;
}