You are here

function shib_auth_admin_general in Shibboleth Authentication 7.4

Same name and namespace in other branches
  1. 6.4 shib_auth_forms.inc \shib_auth_admin_general()

Form constructor for the shib_auth admin general page.

1 string reference to 'shib_auth_admin_general'
shib_auth_menu in ./shib_auth.module
Implements hook_menu().

File

./shib_auth_forms.inc, line 13
Drupal forms of the Shibboleth authentication module.

Code

function shib_auth_admin_general($form, &$form_state) {
  $form = array();
  $form['shib_handler_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Shibboleth handler settings'),
    '#weight' => -10,
    '#collapsible' => FALSE,
  );
  $form['shib_attribute_settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Attribute settings'),
    '#weight' => -5,
    '#collapsible' => FALSE,
  );
  $form['shib_handler_settings']['shib_auth_full_handler_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Shibboleth login handler URL'),
    '#default_value' => shib_auth_config('full_handler_url'),
    '#description' => t('The URL can be absolute or relative to the server base URL: http://www.example.com/Shibboleth.sso/DS; /Shibboleth.sso/DS'),
  );
  $form['shib_handler_settings']['shib_auth_full_logout_url'] = array(
    '#type' => 'textfield',
    '#title' => t('Shibboleth logout handler URL'),
    '#default_value' => shib_auth_config('full_logout_url'),
    '#description' => t('The URL can be absolute or relative to the server base URL: http://www.example.com/Shibboleth.sso/Logout; /Shibboleth.sso/Logout'),
  );
  $form['shib_handler_settings']['shib_auth_link_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Shibboleth login link text'),
    '#default_value' => shib_auth_config('link_text'),
    '#description' => t('The text of the login link. You can change this text on the Shibboleth login block settings form too!'),
  );
  $form['shib_handler_settings']['shib_auth_force_https'] = array(
    '#type' => 'checkbox',
    '#title' => t('Force HTTPS on login'),
    '#description' => t('The user will be redirected to HTTPS'),
    '#default_value' => shib_auth_config('force_https'),
  );
  $form['shib_attribute_settings']['shib_auth_username_variable'] = array(
    '#type' => 'textfield',
    '#title' => t('Server variable for username'),
    '#default_value' => shib_auth_config('username_variable'),
  );
  $form['shib_attribute_settings']['shib_auth_email_variable'] = array(
    '#type' => 'textfield',
    '#title' => t('Server variable for email address'),
    '#default_value' => shib_auth_config('email_variable'),
  );
  $form['shib_attribute_settings']['shib_auth_define_username'] = array(
    '#type' => 'checkbox',
    '#title' => t('User-defined username'),
    '#description' => t('Allow users to set their Drupal username at first Shibboleth login. Note that disabling this option only prevents new users from registering their own username. Existing user-defined usernames will remain valid.'),
    '#default_value' => shib_auth_config('define_username'),
  );
  $form['shib_attribute_settings']['shib_auth_enable_custom_mail'] = array(
    '#type' => 'checkbox',
    '#title' => t('User-defined email addresses'),
    '#description' => t('Ask users to set their contact email address at first login. Disabling this option will override contact address with the one, which was received from IdP. (In this case, missing email address will result in fatal error.)'),
    '#default_value' => shib_auth_config('enable_custom_mail'),
  );
  $form['shib_attribute_settings']['shib_auth_account_linking'] = array(
    '#type' => 'checkbox',
    '#title' => t('Account linking'),
    '#description' => t('Allow locally authenticated users to link their Drupal accounts to federated logins. Note that disabling this option only prevents from creating/removing associations, existing links will remain valid.'),
    '#default_value' => shib_auth_config('account_linking'),
  );
  $form['shib_attribute_settings']['shib_auth_account_linking_text'] = array(
    '#type' => 'textfield',
    '#title' => t('Shibboleth account linking text'),
    '#default_value' => shib_auth_config('account_linking_text'),
    '#description' => t('The text of the link providing account linking shown on the user settings form.'),
  );
  $form['shib_attribute_debug'] = array(
    '#type' => 'fieldset',
    '#title' => 'Debugging options',
    '#weight' => -1,
  );
  $form['shib_attribute_debug']['shib_auth_debug_state'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable DEBUG mode.'),
    '#default_value' => shib_auth_config('debug_state'),
  );
  $form['shib_attribute_debug']['shib_auth_debug_url'] = array(
    '#type' => 'textfield',
    '#title' => t('DEBUG path prefix'),
    '#default_value' => shib_auth_config('debug_url'),
    '#description' => t("For example use 'user/' for display DEBUG messages on paths 'user/*'!"),
  );
  return system_settings_form($form);
}