From 3b0f1c665a23e8f569ce2f1455f1577a7e71a7dd Mon Sep 17 00:00:00 2001 From: LostInIgnorance Date: Wed, 27 Jul 2011 19:48:16 -0500 Subject: Changes to reflect correct loading of AV databases and updates --- config/widget-antivirus/antivirus_status.widget.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/config/widget-antivirus/antivirus_status.widget.php b/config/widget-antivirus/antivirus_status.widget.php index 650c0f95..fee10ea8 100644 --- a/config/widget-antivirus/antivirus_status.widget.php +++ b/config/widget-antivirus/antivirus_status.widget.php @@ -39,6 +39,11 @@ define('PATH_CLAMDB', '/var/db/clamav'); define('PATH_HAVPLOG', '/var/log/havp/access.log'); define('PATH_AVSTATUS', '/var/tmp/havp.status'); + +if (file_exists("/usr/local/pkg/havp.inc")) + require_once("/usr/local/pkg/havp.inc"); +else echo "No havp.inc found"; + function havp_avdb_info($filename) { $stl = "style='padding-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 4px; border-left: 1px solid #999999;'"; @@ -52,7 +57,7 @@ function havp_avdb_info($filename) # datetime $dt = explode(" ", $s[1]); - $s[1] = strftime("%d.%m.%Y", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); + $s[1] = strftime("%m.%d.%Y", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); if ($s[0] == 'ClamAV-VDB') $r .= "{$filename}{$s[1]}{$s[2]}{$s[7]}"; } @@ -66,12 +71,21 @@ function dwg_avbases_info() $db = ''; $db .= ''; $db .= havp_avdb_info("daily.cld"); + $db .= havp_avdb_info("bytecode.cld"); $db .= havp_avdb_info("main.cvd"); $db .= havp_avdb_info("safebrowsing.cld"); $db .= '
DatabaseDateVer.Builder
'; return $db; } +function avupdate_status() +{ + $s = "Not found."; + if (HVDEF_UPD_STATUS_FILE && file_exists(HVDEF_UPD_STATUS_FILE)) + $s = file_get_contents(HVDEF_UPD_STATUS_FILE); + return str_replace( "\n", "
", $s ); +} + function dwg_av_statistic() { $s = "Unknown."; @@ -141,9 +155,7 @@ $s = "Found $count viruses (total)."; Last Update -- cgit v1.2.3