You are here

public function SimpleLdapUserSettingsForm::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

modules/simple_ldap_user/src/Form/SimpleLdapUserSettingsForm.php, line 173

Class

SimpleLdapUserSettingsForm

Namespace

Drupal\simple_ldap_user\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->configFactory()
    ->getEditable('simple_ldap.user');
  $config
    ->set('basedn', $form_state
    ->getValue('basedn'))
    ->set('user_scope', $form_state
    ->getValue('user_scope'))
    ->set('object_class', $form_state
    ->getValue('object_class'))
    ->set('name_attribute', $form_state
    ->getValue('name_attribute'))
    ->set('mail_attribute', $form_state
    ->getValue('mail_attribute'))
    ->set('cron_frequency', $form_state
    ->getValue('cron_frequency'))
    ->save();
  parent::submitForm($form, $form_state);
}