You are here

function shib_auth_admin in Shibboleth Authentication 6.3

Same name and namespace in other branches
  1. 5.3 shib_auth_admin.inc \shib_auth_admin()
  2. 5.2 shib_auth.module \shib_auth_admin()
  3. 6 shib_auth.module \shib_auth_admin()
  4. 6.2 shib_auth.module \shib_auth_admin()

Generate the administration form of the Shibboleth authentication module @returns HTML text of the administration form

1 string reference to 'shib_auth_admin'
shib_auth_menu in ./shib_auth.module
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 379
This is a Shibboleth authentication module.

Code

function shib_auth_admin() {
  global $base_url;
  $form = array();
  $form['shib_handler_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Shibboleth handler settings'),
    '#weight' => 0,
    '#collapsible' => FALSE,
  );
  $form['shib_attribute_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Attribute settings'),
    '#weight' => 0,
    '#collapsible' => FALSE,
  );
  $form['shib_handler_settings']['shib_auth_handler_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Shibboleth handler URL'),
    '#default_value' => variable_get('shib_auth_handler_url', '/Shibboleth.sso'),
    '#description' => t('The URL can be absolute or relative to the server base url: http://www.example.com/Shibboleth.sso; /Shibboleth.sso'),
  );
  $form['shib_handler_settings']['shib_auth_handler_protocol'] = array(
    '#type' => 'select',
    '#title' => t('Shibboleth handler protocol'),
    '#default_value' => variable_get('shib_auth_handler_protocol', 'https'),
    '#options' => array(
      'http' => t('HTTP'),
      'https' => t('HTTPS'),
    ),
    '#description' => t('This option will be effective only if the handler URL is a relative path.'),
  );
  $form['shib_handler_settings']['shib_auth_wayf_uri'] = array(
    '#type' => 'textfield',
    '#title' => t('WAYF location'),
    '#default_value' => variable_get('shib_auth_wayf_uri', '/DS'),
  );
  $form['shib_attribute_settings']['shib_auth_username_variable'] = array(
    '#type' => 'textfield',
    '#title' => t('Server variable for username'),
    '#default_value' => variable_get('shib_auth_username_variable', 'REMOTE_USER'),
  );
  $form['shib_attribute_settings']['shib_auth_username_email'] = array(
    '#type' => 'textfield',
    '#title' => t('Server variable for e-mail address'),
    '#default_value' => variable_get('shib_auth_username_email', 'HTTP_SHIB_MAIL'),
  );
  $form['shib_attribute_settings']['shib_auth_mail_shib_only'] = array(
    '#type' => 'radios',
    '#title' => t('E-mail source settings'),
    '#default_value' => variable_get('shib_auth_mail_shib_only', 0),
    '#options' => array(
      t('Require and use only Shibboleth-provided email address'),
      t('Ask for missing e-mail address'),
    ),
  );
  $form['shib_attribute_debug'] = array(
    '#type' => 'fieldset',
    '#title' => 'Debugging options',
  );
  $form['shib_attribute_debug']['shib_auth_debug_state'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable DEBUG mode.'),
    '#default_value' => variable_get('shib_auth_debug_state', FALSE),
  );
  $form['shib_attribute_debug']['shib_auth_debug_url'] = array(
    '#type' => 'textfield',
    '#title' => t('DEBUG path prefix'),
    '#default_value' => variable_get('shib_auth_debug_url', ''),
    '#description' => t('For example use \'user/\' for display DEBUG messages on paths \'user/*\'!'),
  );
  $form['shib_auth_auto_destroy_session']['shib_auth_auto_destroy_session'] = array(
    '#type' => 'checkbox',
    '#title' => t('Destroy Drupal session when the Shibboleth session expires.'),
    '#default_value' => variable_get('shib_auth_auto_destroy_session', FALSE),
  );
  $form['shib_logout_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Change Logout settings'),
  );
  $form['shib_logout_settings']['shib_logout_url'] = array(
    '#type' => 'textfield',
    '#title' => t("URL to redirect to after logout"),
    '#default_value' => variable_get('shib_logout_url', $base_url),
    '#description' => t("The URL can be absolute or relative to the server base url. The relative paths will be automatically extended with the site base URL."),
  );
  return system_settings_form($form);
}