Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gargron/generic-ban
A generic PHP ban class. Supports IP bans, alt account bans, and expiring bans. Uses redis.
https://github.com/gargron/generic-ban
Last synced: about 1 month ago
JSON representation
A generic PHP ban class. Supports IP bans, alt account bans, and expiring bans. Uses redis.
- Host: GitHub
- URL: https://github.com/gargron/generic-ban
- Owner: Gargron
- Created: 2012-08-14T00:35:48.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-14T01:18:05.000Z (over 12 years ago)
- Last Synced: 2024-10-28T17:44:06.938Z (about 2 months ago)
- Language: PHP
- Homepage:
- Size: 93.8 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## A generic ban class
Yes. For forums and stuff like that. Powered by redis. Uses PHPUnit for optional unit testing.
### Usage
Ban::track('1.2.3.4', 1); // track user with IP 1.2.3.4 and (optional) user ID 1
Ban::make(1, array(), 120); // ban user with the ID 1 for 2 minutes (120 seconds)
if(Ban::is('1.2.3.4', 1)) // check if the IP 1.2.3.4 is banned, or if the optional user ID 1 is banned
{
die('Nope');
}Ban::undo(1); // unban the user with the ID 1
$alts = Ban::alts(1); // get other user IDs of user with the ID 1 (alts)
$ips = Ban::ips(1); // get the IP addresses of the user with the ID 1