From 49a1ae94b6fdb971da15d7df323a60f6899adb8e Mon Sep 17 00:00:00 2001 From: Shish Date: Sat, 28 Jul 2012 11:56:55 +0100 Subject: [PATCH] ban IP as an inet type --- ext/ipban/main.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ext/ipban/main.php b/ext/ipban/main.php index 4561d343..fce032f8 100644 --- a/ext/ipban/main.php +++ b/ext/ipban/main.php @@ -27,7 +27,7 @@ class AddIPBanEvent extends Event { var $reason; var $end; - public function AddIPBanEvent(/*string(ip)*/ $ip, /*sintrg*/ $reason, /*string*/ $end) { + public function AddIPBanEvent(/*string(ip)*/ $ip, /*string*/ $reason, /*string*/ $end) { $this->ip = trim($ip); $this->reason = trim($reason); $this->end = trim($end); @@ -174,6 +174,12 @@ class IPBan extends Extension { $database->Execute("ALTER TABLE bans ADD FOREIGN KEY (banner_id) REFERENCES users(id) ON DELETE CASCADE"); $config->set_int("ext_ipban_version", 7); } + + if($config->get_int("ext_ipban_version") == 7) { + $database->execute($database->scoreql_to_sql("ALTER TABLE bans CHANGE ip ip SCORE_INET")); + $database->execute($database->scoreql_to_sql("ALTER TABLE bans ADD COLUMN added SCORE_DATETIME NOT NULL DEFAULT SCORE_NOW")); + $config->set_int("ext_ipban_version", 8); + } } // }}} // deal with banned person {{{