\BlackList
Blacklist
Logs user details and blocks users based on IP, host, or referer.
- Author: <andrewm@cyber-duck.co.uk>
- License: MIT License https://github.com/cyber-duck/silverstripe-blacklist/blob/master/LICENSE
Synopsis
class BlackList
{
- // members
- private array $bots = ;
- private string $type = 'human';
- private $ip;
- private $host;
- private $referer;
- private bool $logUsers = true;
- private bool $logBots = true;
- private array $ipHeaders = ;
- // methods
- public void __construct()
- public void logUsers()
- public void logBots()
- public void setType()
- public void setIP()
- public void setHost()
- public void setReferer()
- public string getType()
- public string getIP()
- public string getHost()
- public string getReferer()
- public void doLog()
- public void doBlock()
- private void setUserType()
- private void setUserIP()
- private void setUserHost()
- private void setUserReferer()
- private void writeLog()
- private void forbidden()
Members
private
Methods
private
- forbidden() — Forbidden user redirect
- setUserHost() — Set the default user host
- setUserIP() — Set the default user IP
- setUserReferer() — Set the default user referer
- setUserType() — Set the default user type
- writeLog() — Write the current user log
public
- __construct() — Set up default configuration
- doBlock() — Perform the blocking action
- doLog() — Perform the logging action
- getHost() — Get the current user host
- getIP() — Get the current user IP
- getReferer() — Get the current user referer
- getType() — Get the current user type
- logBots() — Enable logging of bots
- logUsers() — Enable logging of users
- setHost() — Set the current user host
- setIP() — Set the current user IP
- setReferer() — Set the current user referer
- setType() — Set the current user type