You are here

public function ShibbolethSettings::submitForm in Shibboleth Authentication 8

Form submission handler.

Parameters

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

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

Overrides ConfigFormBase::submitForm

File

src/Form/ShibbolethSettings.php, line 147

Class

ShibbolethSettings
Class ShibbolethSettings.

Namespace

Drupal\shib_auth\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('shib_auth.shibbolethsettings')
    ->set('shibboleth_login_handler_url', $form_state
    ->getValue('shibboleth_login_handler_url'))
    ->set('shibboleth_logout_handler_url', $form_state
    ->getValue('shibboleth_logout_handler_url'))
    ->set('shibboleth_login_link_text', $form_state
    ->getValue('shibboleth_login_link_text'))
    ->set('force_https_on_login', $form_state
    ->getValue('force_https_on_login'))
    ->set('server_variable_username', $form_state
    ->getValue('server_variable_username'))
    ->set('server_variable_email', $form_state
    ->getValue('server_variable_email'))
    ->set('enable_debug_mode', $form_state
    ->getValue('enable_debug_mode'))
    ->set('debug_prefix_path', $form_state
    ->getValue('debug_prefix_path'))
    ->save();

  // Invalidate the cache for the Shib login block.
  \Drupal::service('cache_tags.invalidator')
    ->invalidateTags([
    'shibboleth_login_block',
  ]);
}