You are here

public function MiniorangeIDPSetup::submitForm in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 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 FormInterface::submitForm

File

src/Form/MiniorangeIDPSetup.php, line 157
Contains \Drupal\miniorange_saml\Form\MiniorangeIDPSetup.

Class

MiniorangeIDPSetup

Namespace

Drupal\miniorange_saml\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $form_values = $form_state
    ->getValues();
  $b_url = $form_values['miniorange_saml_base_url'];
  $issuer_id = $form_values['miniorange_saml_entity_id'];
  \Drupal::configFactory()
    ->getEditable('miniorange_saml.settings')
    ->set('miniorange_saml_base_url', $b_url)
    ->save();
  \Drupal::configFactory()
    ->getEditable('miniorange_saml.settings')
    ->set('miniorange_saml_entity_id', $issuer_id)
    ->save();
  \Drupal::messenger()
    ->addStatus(t('Base URL and/or Issuer updated successfully.'));
}