IpAccessControlService
class IpAccessControlService implements LoggerAwareInterface (View source)
Traits
Trait LoggerAwareTrait A trait used with LoggerAwareInterface
Constants
IPRANGEFLAG_BLACKLIST |
Bit mask for blacklist ranges. |
IPRANGEFLAG_WHITELIST |
Bit mask for whitelist ranges. |
IPRANGEFLAG_MANUAL |
Bit mask for manually generated ranges. |
IPRANGEFLAG_AUTOMATIC |
Bit mask for automatically generated ranges. |
IPRANGETYPE_BLACKLIST_MANUAL |
IP range type: manually added to the blacklist. |
IPRANGETYPE_BLACKLIST_AUTOMATIC |
IP range type: automatically added to the blacklist. |
IPRANGETYPE_WHITELIST_MANUAL |
IP range type: manually added to the whitelist. |
Properties
protected EntityManagerInterface | $em | ||
protected Site | $site | ||
protected IpAccessControlCategory | $category | The IP Access Control Category. |
|
protected AddressInterface | $defaultIpAddress |
Methods
No description
Initialize the instance.
Get the IP Access Control Category.
Check if an IP address is blacklisted.
Check if an IP address is whitelisted.
Create and save an IP Access Control Event.
Check if the IP address has reached the threshold.
Add an IP address to the list of blacklisted IP address when too many events occur.
Add persist an IP address range type.
Get the list of currently available ranges.
Get a saved range for this category given its ID.
Delete the recorded events.
Clear the IP addresses automatically blacklisted.
Get the (localized) message telling the users that their IP address has been banned.
No description
Details
getLoggerChannel()
No description
__construct(EntityManagerInterface $em, Site $site, IpAccessControlCategory $category, AddressInterface $defaultIpAddress)
Initialize the instance.
IpAccessControlCategory
getCategory()
Get the IP Access Control Category.
bool
isBlacklisted(AddressInterface $ipAddress = null)
Check if an IP address is blacklisted.
bool
isWhitelisted(AddressInterface $ipAddress = null)
Check if an IP address is whitelisted.
IpAccessControlEvent|null
registerEvent(AddressInterface $ipAddress = null, bool $evenIfDisabled = false)
Create and save an IP Access Control Event.
bool
isThresholdReached(AddressInterface $ipAddress = null, bool $evenIfDisabled = false)
Check if the IP address has reached the threshold.
IpAccessControlRange|null
addToBlacklistForThresholdReached(AddressInterface $ipAddress = null, bool $evenIfDisabled = false)
Add an IP address to the list of blacklisted IP address when too many events occur.
IpAccessControlRange
createRange(RangeInterface $range, int $type, DateTime $expiration = null)
Add persist an IP address range type.
Collection|IpAccessControlRange[]
getRanges(int $type, bool $includeExpired = false)
Get the list of currently available ranges.
getRangeByID(int $id)
Get a saved range for this category given its ID.
deleteRange(IpAccessControlRange|int $range)
Delete a saved range given its instance or its ID.
int
deleteEvents(int|null $minAge = null)
Delete the recorded events.
int
deleteAutomaticBlacklist(bool $onlyExpired = true)
Clear the IP addresses automatically blacklisted.
string
getErrorMessage()
Get the (localized) message telling the users that their IP address has been banned.
IpAccessControlRange|null
getRange(AddressInterface $ipAddress = null)
No description