public function AutoLoginUrlGeneral::registerFlood in Auto Login URL 2.x
Same name and namespace in other branches
- 8 src/AutoLoginUrlGeneral.php \Drupal\auto_login_url\AutoLoginUrlGeneral::registerFlood()
Register flood event for this IP.
Parameters
string $hash: Code that passes through URL.
File
- src/
AutoLoginUrlGeneral.php, line 46
Class
- AutoLoginUrlGeneral
- Class AutoLoginUrlGeneral.
Namespace
Drupal\auto_login_urlCode
public function registerFlood($hash) {
$flood_config = \Drupal::config('user.flood');
$flood = \Drupal::flood();
// Register flood event.
$flood
->register('user.failed_login_ip', $flood_config
->get('ip_window'));
// Log error.
\Drupal::logger('auto_login_url')
->error('Failed Auto Login URL from ip: @ip and hash: @hash', [
'@ip' => \Drupal::request()
->getClientIp(),
'@hash' => $hash,
]);
}