| @@ -7,9 +7,9 @@ | ||
| 7 | 7 | |
| 8 | 8 | class BVIPStoreCallback extends BVCallbackBase { |
| 9 | 9 | public $db; |
| 10 | 10 | |
| 11 | - const IPSTORE_WING_VERSION = 1.2; | |
| 11 | + const IPSTORE_WING_VERSION = 1.0; | |
| 12 | 12 | |
| 13 | 13 | public function __construct($callback_handler) { |
| 14 | 14 | $this->db = $callback_handler->db; |
| 15 | 15 | } |
| @@ -49,9 +49,9 @@ | ||
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public function getIPs($table, $auto_increment_offset, $type, $category) { |
| 53 | - $query = "SELECT `start_ip_range` FROM $table WHERE id < $auto_increment_offset AND `type` in (" . implode(',', $type) . ") AND "; | |
| 53 | + $query = "SELECT `start_ip_range` FROM $table WHERE id < $auto_increment_offset AND `type` = $type AND "; | |
| 54 | 54 | $query .= ($category == BVIPStore::FW) ? "`is_fw` = true;" : "`is_lp` = true;"; |
| 55 | 55 | return $this->db->getCol($query); |
| 56 | 56 | } |
| 57 | 57 | |
| @@ -62,12 +62,12 @@ | ||
| 62 | 62 | |
| 63 | 63 | public function getIPStoreInfo($table, $auto_increment_offset) { |
| 64 | 64 | $db = $this->db; |
| 65 | 65 | $info = array(); |
| 66 | - $info['fw_blacklisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::blacklistedTypes(), BVIPStore::FW); | |
| 67 | - $info['lp_blacklisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::blacklistedTypes(), BVIPStore::LP); | |
| 68 | - $info['fw_whitelisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::whitelistedTypes(), BVIPStore::FW); | |
| 69 | - $info['lp_whitelisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::whitelistedTypes(), BVIPStore::LP); | |
| 66 | + $info['fw_blacklisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::BLACKLISTED, BVIPStore::FW); | |
| 67 | + $info['lp_blacklisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::BLACKLISTED, BVIPStore::LP); | |
| 68 | + $info['fw_whitelisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::WHITELISTED, BVIPStore::FW); | |
| 69 | + $info['lp_whitelisted_ips'] = $this->getIPs($table, $auto_increment_offset, BVIPStore::WHITELISTED, BVIPStore::LP); | |
| 70 | 70 | $info['ip_store_offset'] = $this->getIPStoreOffset($table, $auto_increment_offset); |
| 71 | 71 | $info['country_ips_size'] = intval($db->getVar("SELECT COUNT(id) FROM $table WHERE id >= $auto_increment_offset")); |
| 72 | 72 | return $info; |
| 73 | 73 | } |