You are here

function shib_auth_menu in Shibboleth Authentication 5.3

Same name and namespace in other branches
  1. 5.2 shib_auth.module \shib_auth_menu()
  2. 6.4 shib_auth.module \shib_auth_menu()
  3. 6 shib_auth.module \shib_auth_menu()
  4. 6.2 shib_auth.module \shib_auth_menu()
  5. 6.3 shib_auth.module \shib_auth_menu()
  6. 7.4 shib_auth.module \shib_auth_menu()

Generate the menu element to access the Shibboleth authentication module's administration page @returns HTML text of the administer menu element

File

./shib_auth.module, line 236
Provides user authentication with Shibboleth (both v1.3 and v2.0) as well as some authorisation features (automatic role assignment base on Shibboleth attributes).

Code

function shib_auth_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/user/shib_auth',
      'title' => t('Shibboleth settings'),
      'description' => t('Control the various settings of the shibboleth authentication module'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'shib_auth_admin',
      ),
      'access' => user_access('administer shibboleth authentication'),
      'weight' => -10,
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/general',
      'title' => t('General settings'),
      'access' => user_access('administer shibboleth authentication'),
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules',
      'title' => t('Shibboleth group rules'),
      'description' => t('Administer the users group membership'),
      'callback' => 'shib_auth_list_rules',
      'access' => user_access('administer permissions'),
      'type' => MENU_LOCAL_TASK,
      'weight' => -8,
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules/general',
      'title' => t('Rules'),
      'access' => user_access('administer shibboleth authentication'),
      'weight' => -10,
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules/New',
      'title' => t('Add new rule'),
      'description' => t('Add new shibboleth based role adjudication'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'shib_auth_new_rule_form',
      ),
      'access' => user_access('administer permissions'),
      'type' => MENU_LOCAL_TASK,
      'weight' => -7,
    );
  }
  else {
    role_assign();
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules/Delete/' . arg(5),
      'callback' => 'shib_auth_delete_rule',
      'callback arguments' => array(
        arg(5),
      ),
      'access' => user_access('administer permissions'),
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules/Edit/' . arg(5),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'shib_auth_edit_rule',
      ),
      'access' => user_access('administer permissions'),
      'type' => MENU_NORMAL_ITEM,
    );
    $items[] = array(
      'path' => 'admin/user/shib_auth/rules/Clone/' . arg(5),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'shib_auth_clone_rule',
      ),
      'access' => user_access('administer permissions'),
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}