\IPLoggerService
Provides a central point via which code can log and review events.
Ideally this service should be injected using SilverStripe's injector.
Synopsis
class IPLoggerService
extends SS_Object
{
- // members
- private static array $rules = ;
- private static boolean $delete_expired = false;
- private static array $dependencies = ;
- public $loggerEntry;
- public $banEntry;
- // methods
- public void __construct()
- public string getIP()
- public void log()
- public DataList getEntries()
- public array|null getRule()
- public DateTime getPastDate()
- public boolean|string checkAllowed()
Hierarchy
Extends
- SS_Object
Members
private
- $delete_expired
- $dependencies
- $rules
public
- $banEntry
- $loggerEntry
Methods
public
- __construct()
- checkAllowed() — Checks if a specific client IP is allowed to perform an event
- getEntries() — Get's an array of logs related to the clients IP and the supplied event.
- getIP() — Returns the IP address of the current client; relies on {@link SS_HTTPRequest} to provide the IP address.
- getPastDate() — Get a date x seconds ago.
- getRule() — If a rule exists for a specific event; return it.
- log() — Logs an event against a clients IP address.