You are here

public function AdvancedSettings::buildForm in Shibboleth Authentication 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

src/Form/AdvancedSettings.php, line 34

Class

AdvancedSettings
Class AdvancedSettings.

Namespace

Drupal\shib_auth\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $config = $this
    ->config('shib_auth.advancedsettings');

  // $form['strict_shibboleth_session_checking'] = array(
  //      '#type' => 'details',
  //      '#title' => $this->t('Strict Shibboleth Session Checking'),
  //      '#open' => 'open',
  //    );
  //    $form['strict_shibboleth_session_checking']['Destroy Session'] = [
  //      '#type' => 'checkbox',
  //      '#title' => $this->t('Destroy Drupal session when the Shibboleth session expires.'),
  //      '#default_value' => $config->get('Destroy Session'),
  //    ];
  //    $form['terms_of_use_settings'] = array(
  //      '#type' => 'details',
  //      '#title' => $this->t('Terms of Use Settings'),
  //      '#open' => 'open',
  //    );
  //    $form['terms_of_use_settings']['force_terms_of_use'] = [
  //      '#type' => 'checkbox',
  //      '#title' => $this->t('Force users to accept Terms of Use'),
  //      '#default_value' => $config->get('force_terms_of_use'),
  //    ];
  //    $form['terms_of_use_settings']['url_of_document'] = [
  //      '#type' => 'textfield',
  //      '#title' => $this->t('URL of the document'),
  //      '#description' => $this->t('Please refence local content with e.g. "node/1", or use an external link.'),
  //      '#maxlength' => 128,
  //      '#size' => 64,
  //      '#default_value' => $config->get('url_of_document'),
  //    ];
  //    $form['terms_of_use_settings']['document_version'] = [
  //      '#type' => 'textfield',
  //      '#title' => $this->t('Document version'),
  //      '#maxlength' => 64,
  //      '#size' => 10,
  //      '#default_value' => $config->get('document_version'),
  //    ];.
  $form['login_settings'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Login Settings'),
    '#open' => 'open',
  ];
  $form['login_settings']['url_redirect_login'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('URL to redirect to after login'),
    '#description' => $this
      ->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. If this value is empty, then the user will be redirected to the originally requested page.'),
    '#maxlength' => 128,
    '#size' => 64,
    '#default_value' => $config
      ->get('url_redirect_login'),
  ];
  $form['logout_settings'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Logout Settings'),
    '#open' => 'open',
  ];
  $form['logout_settings']['url_redirect_logout'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('URL to redirect to after logout'),
    '#description' => $this
      ->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. If you are using SLO, this setting is probably useless (depending on the IdP)'),
    '#maxlength' => 128,
    '#size' => 64,
    '#default_value' => $config
      ->get('url_redirect_logout'),
  ];
  $form['logout_settings']['logout_error_message'] = [
    '#type' => 'textarea',
    '#title' => $this
      ->t('Error Page Message'),
    '#default_value' => $config
      ->get('logout_error_message'),
    '#description' => $this
      ->t('Error message displayed to the user (if an error occurs).'),
  ];

  // $form['advanced_saml2_settings'] = array(
  //      '#type' => 'details',
  //      '#title' => $this->t('Advanced SAML2 Settings'),
  //      '#open' => 'open',
  //    );
  //    $form['advanced_saml2_settings']['enable_passive_authentication'] = [
  //      '#type' => 'checkbox',
  //      '#title' => $this->t('Enable passive authentication'),
  //      '#description' => $this->t('Enable passive authentication'),
  //      '#default_value' => $config->get('enable_passive_authentication'),
  //    ];
  //    $form['advanced_saml2_settings']['enable_forced_authentication'] = [
  //      '#type' => 'checkbox',
  //      '#title' => $this->t('Enable forced authentication'),
  //      '#description' => $this->t('Enable forced authentication'),
  //      '#default_value' => $config->get('enable_forced_authentication'),
  //    ];.
  return parent::buildForm($form, $form_state);
}