From 178f34f25bdc617f70a584273b0f40a2d0cb4779 Mon Sep 17 00:00:00 2001 From: dvserg Date: Sun, 21 Nov 2010 10:35:10 +0300 Subject: HAVP firewall rules fix for 2.0, status avupdate message fix. --- config/havp/antivirus.php | 54 +++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'config/havp/antivirus.php') diff --git a/config/havp/antivirus.php b/config/havp/antivirus.php index 79ff31e7..fa03301e 100644 --- a/config/havp/antivirus.php +++ b/config/havp/antivirus.php @@ -42,27 +42,40 @@ define('PATH_CLAMDB', '/var/db/clamav'); define('PATH_HAVPLOG', '/var/log/havp/access.log'); define('PATH_AVSTATUS', '/var/tmp/havp.status'); -function get_avdb_info($filename) +function get_avdb_info() { - $stl = "style='padding-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 4px; border-left: 1px solid #999999;'"; - $r = ''; + $r = ''; $path = PATH_CLAMDB . "/{$filename}"; - if (file_exists($path)) { - $handle = ''; - if ($handle = fopen($path, "r")) { - $fsize = sprintf("%.2f M", filesize($path)/1024/1024); + $fl = get_dir(PATH_CLAMDB . "/"); + + array_shift($fl); + array_shift($fl); + + foreach ($fl as $fname) { + $path = PATH_CLAMDB . "/{$fname}"; + $ext = end(explode(".", $fname)); + + if ( $ext == "cvd" || $ext == "cld") { + $stl = "style='padding-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 4px; border-left: 1px solid #999999;'"; + if (file_exists($path)) { + $handle = ''; + if ($handle = fopen($path, "r")) { + $fsize = sprintf("%.2f M", filesize($path)/1024/1024); - $s = fread($handle, 1024); - $s = explode(':', $s); - - # datetime - $dt = explode(" ", $s[1]); - $s[1] = strftime("%d.%m.%Y", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); - if ($s[0] == 'ClamAV-VDB') - $r .= "{$filename}{$s[1]}$fsize{$s[2]}{$s[3]}{$s[7]}"; + $s = fread($handle, 1024); + $s = explode(':', $s); + + # datetime + $dt = explode(" ", $s[1]); + $s[1] = strftime("%d.%m.%Y", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); + if ($s[0] == 'ClamAV-VDB') + $r .= "{$fname}{$s[1]}$fsize{$s[2]}{$s[3]}{$s[7]}"; + } + fclose($handle); + } } - fclose($handle); } + return $r; } @@ -114,7 +127,7 @@ 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 $s; + return str_replace( "\n", "
", $s ); } # ------------------------------------------------------------------------------ @@ -258,12 +271,7 @@ if (pfsense_version_A() == '1') { - - - - - - +
DatabaseDateSizeVer.SignaturesBuilder
-- cgit v1.2.3