From 1e4d066f5d8e8b70cb91653874484a2d626f3358 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 29 Aug 2015 22:05:03 +0200 Subject: Remove disfunctional junk and fix HAVP version check --- .../widget-antivirus/antivirus_status.widget.php | 33 ++++++++-------------- 1 file changed, 11 insertions(+), 22 deletions(-) (limited to 'config') diff --git a/config/widget-antivirus/antivirus_status.widget.php b/config/widget-antivirus/antivirus_status.widget.php index 9c18d3f6..77685c20 100644 --- a/config/widget-antivirus/antivirus_status.widget.php +++ b/config/widget-antivirus/antivirus_status.widget.php @@ -30,6 +30,7 @@ require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); +require_once("pkg-utils.inc"); define('PATH_CLAMDB', '/var/db/clamav'); define('PATH_HAVPLOG', '/var/log/access.log'); @@ -91,26 +92,6 @@ function dwg_av_statistic() { $log = file_get_contents(PATH_HAVPLOG); $count = substr_count(strtolower($log), "virus clamd:"); $s = "Found $count viruses (total)."; - -/* -# slowly worked - need apply cache or preparse stat - - $log = explode("\n", $log); - # counters: day, week, mon, total - $count = 0; - foreach($log as $ln) { - $ln = explode(' ', $ln); - # 0:date 1:time 2:ip 3:get 4:len 5:url 6:xx 7:status - if (strpos(strtolower($ln[7]), "virus") !== false) { - $count++; - } - } - $s = "Found viruses:
"; - $s .= ""; - $s .= ""; - $s .= ""; - $s .= "
todayweekmontotal
000$count
"; -*/ } return $s; } @@ -123,8 +104,16 @@ function dwg_av_statistic() { HTTP Scanner -- cgit v1.2.3