Small fixes.

This commit is contained in:
Andrea Santaniello 2022-09-20 19:00:42 +02:00
parent 13e7aaf090
commit 827853ffbd
2 changed files with 4 additions and 4 deletions

View File

@ -75,7 +75,7 @@ function reportExists($db, $name, $protocol, $port, $ip)
'ip' => $ip 'ip' => $ip
] ]
); );
if(!$stmt) { return -1; } if(!$stmt) { return false; }
return $stmt->fetchColumn(); return $stmt->fetchColumn();
} }
@ -101,7 +101,7 @@ function honeypot($name, $protocol, $port)
$report = reportExists($db, $name, $protocol, $port, $ip); $report = reportExists($db, $name, $protocol, $port, $ip);
if($report != -1) if($report != false)
{ {
updateReport($db, $report); updateReport($db, $report);
} else { } else {
@ -129,7 +129,7 @@ function serve()
{ {
$report = reportExists($db, $name, $protocol, $port, $ip); $report = reportExists($db, $name, $protocol, $port, $ip);
if($report != -1) if($report != false)
{ {
updateReport($db, $report); updateReport($db, $report);
} else { } else {

View File

@ -1,7 +1,7 @@
CREATE TABLE `naughtylist` ( CREATE TABLE `naughtylist` (
`id` int(11) NOT NULL, `id` int(11) NOT NULL,
`name` text NOT NULL, `name` text NOT NULL,
`protocol` varchar(4) NOT NULL, `protocol` varchar(10) NOT NULL,
`port` int(11) NOT NULL, `port` int(11) NOT NULL,
`ip` varchar(20) NOT NULL, `ip` varchar(20) NOT NULL,
`count` int(11) NOT NULL, `count` int(11) NOT NULL,