You are here

public function BanDelete::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/ban/src/Form/BanDelete.php \Drupal\ban\Form\BanDelete::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

core/modules/ban/src/Form/BanDelete.php, line 92
Contains \Drupal\ban\Form\BanDelete.

Class

BanDelete
Provides a form to unban IP addresses.

Namespace

Drupal\ban\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $this->ipManager
    ->unbanIp($this->banIp);
  $this
    ->logger('user')
    ->notice('Deleted %ip', array(
    '%ip' => $this->banIp,
  ));
  drupal_set_message($this
    ->t('The IP address %ip was deleted.', array(
    '%ip' => $this->banIp,
  )));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}