Internetrix\CMSAdminIPRestriction\AllowedIPMiddleware
Class AllowedIPMiddleware
Synopsis
class AllowedIPMiddleware
implements
HTTPMiddleware
{
- // members
- private bool $enabled = false;
- private array $restrictedControllers = ;
- private array $allowedIPs = ;
- // methods
- public array getAllowedIPs()
- public $this setAllowedIPs()
- public HTTPResponse process()
- public bool IPRestrictionApplies()
- public bool validateIPAddress()
- public bool isEnabled()
- public array getRestrictedControllers()
- public bool canBypassIPRestriction()
Hierarchy
Uses
- SilverStripe\Core\Config\Configurable
Implements
- SilverStripe\Control\Middleware\HTTPMiddleware
Members
private
- $allowedIPs — array
- $enabled — Internetrix\CMSAdminIPRestriction\bool
- $restrictedControllers — array
Methods
public
- IPRestrictionApplies() — Checks if IP restriction needs to be applied to the current request
- canBypassIPRestriction() — If a user is an ADMIN, they are allowed to potentially bypass the IP restriction check if manually set in the CMS admin
- getAllowedIPs()
- getRestrictedControllers() — Return the Controller classes that the IP restrictions applies to
- isEnabled() — Check if IP restriction is enabled in YML config
- process()
- setAllowedIPs()
- validateIPAddress() — Check if the current IP address is one of the allowed IP addresses