From 7b86e2ac59cf762a6f036bec3b83d8fb82789124 Mon Sep 17 00:00:00 2001 From: lucatiozzo91 Date: Wed, 16 Mar 2022 13:53:00 +0000 Subject: [PATCH] always show banned host in ui When an host is banned but the updated_time field is in the past the ui didn't show the record. Fixes #758 Signed-off-by: lucatiozzo91 --- dataprovider/sqlqueries.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataprovider/sqlqueries.go b/dataprovider/sqlqueries.go index 1342bba1..d999566d 100644 --- a/dataprovider/sqlqueries.go +++ b/dataprovider/sqlqueries.go @@ -47,7 +47,7 @@ func getAddDefenderEventQuery() string { } func getDefenderHostsQuery() string { - return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v ORDER BY updated_at DESC LIMIT %v`, + return fmt.Sprintf(`SELECT id,ip,ban_time FROM %v WHERE updated_at >= %v OR ban_time > 0 ORDER BY updated_at DESC LIMIT %v`, sqlTableDefenderHosts, sqlPlaceholders[0], sqlPlaceholders[1]) }