public function onEvent(GenericEvent $event, $eventName) { $identifier = $this->ir->getMixedIdentifier(); $denyExpire = $this->redis->get('SECURITY:DENY:' . $identifier); if ($denyExpire === false) { // not listed in blacklist return; } $this->response->setStatusCode(Response::HTTP_FORBIDDEN); $this->response->headers->set('content-type', 'text/html'); $this->response->setContent(Application::trans('error.code.ip_blacklisted', ['seconds' => $denyExpire === 0 ? mt_rand() : ceil(($denyExpire - time()) / 60) * 60])); $this->response->send(); $event->stopPropagation(); }