class IpBanMiddleware in IP Ban 8
Provides a HTTP middleware to implement IP based banning.
Hierarchy
- class \Drupal\ip_ban\IpBanMiddleware implements \Symfony\Component\HttpKernel\HttpKernelInterface
Expanded class hierarchy of IpBanMiddleware
1 string reference to 'IpBanMiddleware'
1 service uses IpBanMiddleware
File
- src/
IpBanMiddleware.php, line 14
Namespace
Drupal\ip_banView source
class IpBanMiddleware implements HttpKernelInterface {
/**
* The decorated kernel.
*
* @var \Symfony\Component\HttpKernel\HttpKernelInterface
*/
protected $httpKernel;
/**
* The IP ban manager.
*
* @var \Drupal\ip_ban\IpBanSetBanInterface
*/
protected $iPBanManager;
/**
* Constructs a BanMiddleware object.
*
* @param \Symfony\Component\HttpKernel\HttpKernelInterface $http_kernel
* The decorated kernel.
* @param \Drupal\ban\IpBanSetBanInterface $manager
* The IP Ban manager.
*/
public function __construct(HttpKernelInterface $http_kernel, IpBanSetBanInterface $manager) {
$this->httpKernel = $http_kernel;
$this->iPBanManager = $manager;
}
/**
* {@inheritdoc}
*/
public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = TRUE) {
$this->iPBanManager
->iPBanSetValue();
$this->iPBanManager
->iPBanDetermineAction();
return $this->httpKernel
->handle($request, $type, $catch);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IpBanMiddleware:: |
protected | property | The decorated kernel. | |
IpBanMiddleware:: |
protected | property | The IP ban manager. | |
IpBanMiddleware:: |
public | function | ||
IpBanMiddleware:: |
public | function | Constructs a BanMiddleware object. |