public function BanAdmin::submitForm

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: An associative array containing the current state of the form.

Overrides FormInterface::submitForm

File

drupal/core/modules/ban/lib/Drupal/ban/Form/BanAdmin.php, line 130
Contains \Drupal\ban\Form\BanAdmin.

Class

BanAdmin
Displays banned IP addresses.

Namespace

Drupal\ban\Form

Code

public function submitForm(array &$form, array &$form_state) {
  $ip = trim($form_state['values']['ip']);
  $this->ipManager
    ->banIp($ip);
  drupal_set_message(t('The IP address %ip has been banned.', array(
    '%ip' => $ip,
  )));
  $form_state['redirect'] = 'admin/config/people/ban';
}