class IpBanSubscriber in IP Ban 8
Hierarchy
- class \Drupal\ip_ban\EventSubscriber\IpBanSubscriber implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
Expanded class hierarchy of IpBanSubscriber
1 file declares its use of IpBanSubscriber
- ip_ban.module in ./
ip_ban.module - Module can "ban" or set site to "read only" by country or IP address.
1 string reference to 'IpBanSubscriber'
1 service uses IpBanSubscriber
File
- src/
EventSubscriber/ IpBanSubscriber.php, line 16 - Contains \Drupal\ip_ban\EventSubscriber\IpBanSubscriber.
Namespace
Drupal\ip_ban\EventSubscriberView source
class IpBanSubscriber implements EventSubscriberInterface {
/**
* The IP ban manager.
*
* @var \Drupal\ip_ban\IpBanSetBanInterface
*/
protected $iPBanManager;
/**
* Constructs a BanMiddleware object.
*
* @param \Drupal\ban\IpBanSetBanInterface $manager
* The IP Ban manager.
*/
public function __construct(IpBanSetBanInterface $manager) {
$this->iPBanManager = $manager;
}
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() {
$events[KernelEvents::REQUEST][] = array(
'hookInit',
255,
);
return $events;
}
/**
* Sets the ban value and action for authenticated users.
*
* @param \Symfony\Component\HttpKernel\Event\GetResponseEvent $event
* The event to process.
*/
public function hookInit(GetResponseEvent $event) {
// \Drupal::service("router.builder")->rebuild();
$this->iPBanManager
->iPBanSetValue();
$this->iPBanManager
->iPBanDetermineAction();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IpBanSubscriber:: |
protected | property | The IP ban manager. | |
IpBanSubscriber:: |
public static | function | ||
IpBanSubscriber:: |
public | function | Sets the ban value and action for authenticated users. | |
IpBanSubscriber:: |
public | function | Constructs a BanMiddleware object. |