function UserFloodSubscriber::blockedIp

Same name in other branches
  1. 10 core/modules/user/src/EventSubscriber/UserFloodSubscriber.php \Drupal\user\EventSubscriber\UserFloodSubscriber::blockedIp()
  2. 11.x core/modules/user/src/EventSubscriber/UserFloodSubscriber.php \Drupal\user\EventSubscriber\UserFloodSubscriber::blockedIp()

An attempt to login has been blocked based on IP.

Parameters

\Drupal\user\Event\UserFloodEvent $floodEvent: The flood event.

File

core/modules/user/src/EventSubscriber/UserFloodSubscriber.php, line 66

Class

UserFloodSubscriber
Logs details of User Flood Control events.

Namespace

Drupal\user\EventSubscriber

Code

public function blockedIp(UserFloodEvent $floodEvent) {
    if (Settings::get('log_user_flood', TRUE)) {
        $this->logger
            ->notice('Flood control blocked login attempt from %ip', [
            '%ip' => $floodEvent->getIp(),
        ]);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.