You are here

public function SimpleLdapServerSettingsForm::submitForm in Simple LDAP 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/SimpleLdapServerSettingsForm.php, line 134

Class

SimpleLdapServerSettingsForm

Namespace

Drupal\simple_ldap\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->configFactory()
    ->getEditable('simple_ldap.server');
  $config
    ->set('host', $form_state
    ->getValue('host'))
    ->set('port', $form_state
    ->getValue('port'))
    ->set('encryption', $form_state
    ->getValue('encryption'))
    ->set('readonly', $form_state
    ->getValue('readonly'))
    ->set('binddn', $form_state
    ->getValue('binddn'))
    ->set('bindpw', $form_state
    ->getValue('bindpw'))
    ->set('basedn', $form_state
    ->getValue('basedn'))
    ->set('opt_referrals', $form_state
    ->getValue('opt_referrals'))
    ->save();
  parent::submitForm($form, $form_state);
}