} if ($type === "ipv6") { $whitelist_6 = array(); $whitelist_6 = return_whitelist_6(); // check if the IP matches entries in our whitelist if (in_subnet_ipv6($ip, $whitelist_6)) { error_log("{$time} [{$script_name}] [rtbh] [{$remote_addr}-{$myuser}] [FAILED to insert, IP {$ip} matches whitelist_6 ranges]\n", 3, $log_file); $error = " IP matches in whitelist ranges, cannot continue "; } } } if ($error === "") { //$rows = $db->insert6($table_name, $ip, $cidr, $type, $description); $query_insert = sprintf("insert into `%s` (sourceip, cidr, type, inserttime,expiretime,hits,country,comment,insertby,allow_edit) VALUES (inet6_pton('%s'),'%s','%s', NOW(), '%s',0,'US','%s','%s','Y') ON DUPLICATE KEY UPDATE inserttime=VALUES(inserttime),expiretime=VALUES(expiretime),hits=VALUES(hits),country=VALUES(country),insertby=VALUES(insertby),comment=VALUES(comment)", $table_name, $ip, $cidr, $type, $expiretime, $description, $_SESSION['USER']); //echo $query_insert; $rows = $db->rawInsert($query_insert); } // main if } else { // missing required POST vars error_log("{$time} [{$script_name}] [rtbh] [{$remote_addr}-{$myuser}] [invalid POST data]\n", 3, $log_file); $error = " invalid post data "; } ?> <!doctype html> <html lang="en-US"> <head> <meta charset="utf-8" /> <meta name="description" content="rtbh"> <title>rtbh</title>