I swear this worked before I looked at it and realised it couldn't possibly work o_O
git-svn-id: file:///home/shish/svn/shimmie2/trunk@902 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
parent
c5ed35fba7
commit
1f11bbc7c1
@ -189,17 +189,8 @@ class IPBan extends Extension {
|
||||
|
||||
private function add_ip_ban($ip, $reason, $end, $user) {
|
||||
global $database;
|
||||
$parts = array();
|
||||
if(preg_match("/^(\d+) (day|week|month)s?$/i", $end, $parts)) {
|
||||
$sql = "INSERT INTO bans (ip, reason, end, banner_id)
|
||||
VALUES (?, ?, ?, ?)";
|
||||
$database->Execute($sql, array($ip, $reason, strtotime("+{$parts[1]} {$parts[2]}"), $user->id));
|
||||
}
|
||||
else {
|
||||
$sql = "INSERT INTO bans (ip, reason, banner_id)
|
||||
VALUES (?, ?, ?)";
|
||||
$database->Execute($sql, array($ip, $reason, $user->id));
|
||||
}
|
||||
$sql = "INSERT INTO bans (ip, reason, end, banner_id) VALUES (?, ?, ?, ?)";
|
||||
$database->Execute($sql, array($ip, $reason, strtotime($end), $user->id));
|
||||
}
|
||||
|
||||
private function remove_ip_ban($id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user