diff options
author | Chris Buechler <cmb@pfsense.org> | 2011-07-27 19:34:25 -0700 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2011-07-27 19:34:25 -0700 |
commit | 7ef22deaad43fc66536a61f102e65464206aa5b1 (patch) | |
tree | 159f4ebe125d1926ca086df5c5e4c1530d930de4 /config | |
parent | 3067f9c56c2d87b259d7f034acceda9dfe1a3cff (diff) | |
parent | 3b0f1c665a23e8f569ce2f1455f1577a7e71a7dd (diff) | |
download | pfsense-packages-7ef22deaad43fc66536a61f102e65464206aa5b1.tar.gz pfsense-packages-7ef22deaad43fc66536a61f102e65464206aa5b1.tar.bz2 pfsense-packages-7ef22deaad43fc66536a61f102e65464206aa5b1.zip |
Merge pull request #9 from LostInIgnorance/patch-1
Changes to reflect correct loading of AV databases and updates
Diffstat (limited to 'config')
-rw-r--r-- | config/widget-antivirus/antivirus_status.widget.php | 20 |
1 files 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 .= "<tr class='listr'><td>{$filename}</td><td $stl>{$s[1]}</td><td $stl>{$s[2]}</td><td $stl>{$s[7]}</td></tr>"; } @@ -66,12 +71,21 @@ function dwg_avbases_info() $db = '<table width="100%" border="0" cellspacing="0" cellpadding="1" ><tbody>'; $db .= '<tr class="vncellt" ><td>Database</td><td>Date</td><td>Ver.</td><td>Builder</td></tr>'; $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 .= '</tbody></table>'; 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", "<br>", $s ); +} + function dwg_av_statistic() { $s = "Unknown."; @@ -141,9 +155,7 @@ $s = "Found $count viruses (total)."; <td class="vncellt">Last Update</td> <td class="listr" width=75%> <?php - if (file_exists(PATH_AVSTATUS)) - echo file_get_contents(PATH_AVSTATUS); - else echo "Unknown." + echo avupdate_status(); ?> </td> </tr> |