You are here

public function LoginSecurityAdminSettings::submitForm in Login Security 8

Same name and namespace in other branches
  1. 2.x src/Form/LoginSecurityAdminSettings.php \Drupal\login_security\Form\LoginSecurityAdminSettings::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/LoginSecurityAdminSettings.php, line 204

Class

LoginSecurityAdminSettings
Class LoginSecurityAdminSettings.

Namespace

Drupal\login_security\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this
    ->configFactory()
    ->getEditable('login_security.settings')
    ->set('track_time', $form_state
    ->getValue('track_time'))
    ->set('user_wrong_count', $form_state
    ->getValue('user_wrong_count'))
    ->set('host_wrong_count', $form_state
    ->getValue('host_wrong_count'))
    ->set('host_wrong_count_hard', $form_state
    ->getValue('host_wrong_count_hard'))
    ->set('activity_threshold', $form_state
    ->getValue('activity_threshold'))
    ->set('disable_core_login_error', $form_state
    ->getValue('disable_core_login_error'))
    ->set('notice_attempts_available', $form_state
    ->getValue('notice_attempts_available'))
    ->set('last_login_timestamp', $form_state
    ->getValue('last_login_timestamp'))
    ->set('last_login_timestamp', $form_state
    ->getValue('last_login_timestamp'))
    ->set('last_access_timestamp', $form_state
    ->getValue('last_access_timestamp'))
    ->set('login_activity_notification_emails', $form_state
    ->getValue('login_activity_notification_emails'))
    ->set('user_blocked_notification_emails', $form_state
    ->getValue('user_blocked_notification_emails'))
    ->set('notice_attempts_message', $form_state
    ->getValue('notice_attempts_message'))
    ->set('host_soft_banned', $form_state
    ->getValue('host_soft_banned'))
    ->set('host_hard_banned', $form_state
    ->getValue('host_hard_banned'))
    ->set('user_blocked', $form_state
    ->getValue('user_blocked'))
    ->set('user_blocked_email_subject', $form_state
    ->getValue('user_blocked_email_subject'))
    ->set('user_blocked_email_body', $form_state
    ->getValue('user_blocked_email_body'))
    ->set('login_activity_email_subject', $form_state
    ->getValue('login_activity_email_subject'))
    ->set('login_activity_email_body', $form_state
    ->getValue('login_activity_email_body'))
    ->save();
  parent::submitForm($form, $form_state);
}