Madmatt\IPLists\Service\IPListService
Synopsis
class IPListService
{
- // constants
- const IP_ACCESS_ALLOWED = 1;
- const IP_ACCESS_DENIED = 0;
- const IP_ACCESS_AMBIVALENT = 1;
- // members
- public Logger $auditLogger;
- private static array $dependencies = ;
- private IPList $matchedList;
- private array $validLists = ;
- // methods
- public bool canAccess()
- public int canAccessWithList()
- public void getDenialResponse()
- protected string getCurrentRoute()
- protected void log()
Tasks
Line | Task |
---|---|
56 | Ideally we don't want to use the ORM here too much, as it results in uncachable queries |
Constants
Name | Value |
---|---|
IP_ACCESS_ALLOWED | 1 |
IP_ACCESS_DENIED | 0 |
IP_ACCESS_AMBIVALENT | 1 |
Members
private
- $dependencies
- $matchedList — Madmatt\IPLists\Model\IPList
- $validLists — array
public
- $auditLogger — Monolog\Logger
Methods
protected
- getCurrentRoute() — Gets the current route URL, without URL params, starting with a leading slash
- log()
public
- canAccess() — Check all {@link IPList} objects to find any that match the given URL route. If one is found, confirm whether the current user's IP address is allowed to access the route or not.
- canAccessWithList() — Reviews whether a given IPList would allow or deny access, or whether the list does not match the provided HTTPRequest.
- getDenialResponse()