You are here

public function FloodUnblockAdminForm::submitForm in Flood Unblock 8

Same name and namespace in other branches
  1. 8.2 src/Form/FloodUnblockAdminForm.php \Drupal\flood_unblock\Form\FloodUnblockAdminForm::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 FormInterface::submitForm

File

src/Form/FloodUnblockAdminForm.php, line 139

Class

FloodUnblockAdminForm
Admin form of Flood unblock.

Namespace

Drupal\flood_unblock\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  foreach ($form_state
    ->getValue('table') as $value) {
    if ($value !== 0) {
      $type = $form['table']['#options'][$value]['type'];
      switch ($type) {
        case 'ip':
          $type = '.failed_login_ip';
          break;
        case 'user':
          $type = '.failed_login_user';
          break;
      }
      $identifier = $value;
      $this->floodUnblockManager
        ->flood_unblock_clear_event($type, $identifier);
    }
  }
}