You are here

public function SamlSpConfig::submitForm in SAML Service Provider 8.2

Same name and namespace in other branches
  1. 8.3 src/Form/SamlSpConfig.php \Drupal\saml_sp\Form\SamlSpConfig::submitForm()
  2. 4.x src/Form/SamlSpConfig.php \Drupal\saml_sp\Form\SamlSpConfig::submitForm()
  3. 3.x src/Form/SamlSpConfig.php \Drupal\saml_sp\Form\SamlSpConfig::submitForm()

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/SamlSpConfig.php, line 43
Contains \Drupal\saml_sp\Form\SamlSpConfigSPForm.

Class

SamlSpConfig

Namespace

Drupal\saml_sp\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this->configFactory
    ->getEditable('saml_sp.settings');
  $values = $form_state
    ->getValues();
  $this
    ->configRecurse($config, $values['contact'], 'contact');
  $this
    ->configRecurse($config, $values['organization'], 'organization');
  $this
    ->configRecurse($config, $values['security'], 'security');
  $config
    ->set('strict', (bool) $values['strict']);
  $config
    ->set('debug', (bool) $values['debug']);
  $config
    ->set('key_location', $values['key_location']);
  $config
    ->set('cert_location', $values['cert_location']);
  $config
    ->set('new_cert_location', $values['new_cert_location']);
  $config
    ->set('entity_id', $values['entity_id']);
  $config
    ->save();
  if (method_exists($this, '_submitForm')) {
    $this
      ->_submitForm($form, $form_state);
  }
  parent::submitForm($form, $form_state);
}