From f1841f89e8929d3042efc6d55147648d2eb69aee Mon Sep 17 00:00:00 2001
From: doktornotor ";
- }
- fclose($handle);
- }
- }
- }
-
- return $r;
-}
-
-function get_av_statistic()
-{
- return function_exists("havp_get_av_statistic") ? havp_get_av_statistic() : "Function 'havp_get_av_statistic' not found.";
+function get_avdb_info() {
+ $r = '';
+ $path = PATH_CLAMDB . "/{$filename}";
+ $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("%Y.%m.%d", 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);
+ }
+ }
+ }
+
+ return $r;
}
-function get_av_viruslog()
-{
- return function_exists("havp_get_av_viruslog") ? havp_get_av_viruslog() : "Function 'havp_get_av_viruslog' not found.";
+function get_av_statistic() {
+ return function_exists("havp_get_av_statistic") ? havp_get_av_statistic() : "Function 'havp_get_av_statistic' not found.";
}
-function get_scanlist()
-{
- return function_exists("havp_get_filescanlist") ? havp_get_filescanlist() : "Function 'havp_get_filescanlist()' not found.";
+function get_av_viruslog() {
+ return function_exists("havp_get_av_viruslog") ? havp_get_av_viruslog() : "Function 'havp_get_av_viruslog' not found.";
}
-function get_scan_log()
-{
- $s = function_exists("havp_get_scan_log") ? havp_get_scan_log() : "Function 'havp_get_scan_log()' not found.";
- $s = str_replace("\n", "{$fname} {$s[1]} $fsize {$s[2]} {$s[3]} {$s[7]}
", $s);
- return $s;
+function get_scanlist() {
+ return function_exists("havp_get_filescanlist") ? havp_get_filescanlist() : "Function 'havp_get_filescanlist()' not found.";
}
-function pfsense_version_A()
-{
- return function_exists("pfsense_version_") ? pfsense_version_() : 1;
+function get_scan_log() {
+ $s = function_exists("havp_get_scan_log") ? havp_get_scan_log() : "Function 'havp_get_scan_log()' not found.";
+ $s = str_replace("\n", "
", $s);
+ return $s;
}
-function havp_status()
-{
- $s = "";
- if (HVDEF_HAVP_STATUS_FILE && file_exists(HVDEF_HAVP_STATUS_FILE))
- $s = file_get_contents(HVDEF_HAVP_STATUS_FILE);
- return $s;
+function havp_status() {
+ $s = "";
+ if (HVDEF_HAVP_STATUS_FILE && file_exists(HVDEF_HAVP_STATUS_FILE)) {
+ $s = file_get_contents(HVDEF_HAVP_STATUS_FILE);
+ }
+ return $s;
}
-function clamd_status()
-{
- $s = "";
- if (HVDEF_CLAM_STATUS_FILE && file_exists(HVDEF_CLAM_STATUS_FILE))
- $s = file_get_contents(HVDEF_CLAM_STATUS_FILE);
- return $s;
+function clamd_status() {
+ $s = "";
+ if (HVDEF_CLAM_STATUS_FILE && file_exists(HVDEF_CLAM_STATUS_FILE)) {
+ $s = file_get_contents(HVDEF_CLAM_STATUS_FILE);
+ }
+ return $s;
}
-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 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 );
}
-# ------------------------------------------------------------------------------
-
-/* start service */
-if($_POST['start'] != '') {
- #start_service($_POST['start']);
- if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
- mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " start");
- sleep(3);
- }
-} else
-/* restart service */
-if($_POST['restart'] != '') {
- #restart_service($_POST['restart']);
- if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
- mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " restart");
- sleep(3);
- }
-} else
-/* stop service */
-if($_POST['stop'] != '') {
- #stop_service($_POST['stop']);
- if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
- mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " stop");
- sleep(3);
- }
+/* ------------------------------------------------------------------------------ */
+
+/* Start service */
+if ($_POST['start'] != '') {
+ // start_service($_POST['start']);
+ if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
+ mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " start");
+ sleep(3);
+ }
+/* Restart service */
+} elseif ($_POST['restart'] != '') {
+ // restart_service($_POST['restart']);
+ if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
+ mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " restart");
+ sleep(3);
+ }
+/* Stop service */
+} elseif ($_POST['stop'] != '') {
+ // stop_service($_POST['stop']);
+ if (file_exists(HVDEF_HAVP_STARTUP_SCRIPT)) {
+ mwexec_bg (HVDEF_HAVP_STARTUP_SCRIPT . " stop");
+ sleep(3);
+ }
}
/* Scan start */
if ($_POST['scanpath'] != '') {
$scandir = $_POST['scanpath'];
- if(function_exists("start_antivirus_scanner")) {
+ if (function_exists("start_antivirus_scanner")) {
start_antivirus_scanner($scandir);
- }
- else echo "No 'start_antivirus_scanner' function found.";
+ }
}
/* Start AV Update */
if ($_POST['startupdate'] != '') {
- if( function_exists("havp_update_AV")) {
- havp_update_AV();
- }
-# else echo "No 'start_antivirus_scanner' function found.";
+ if (function_exists("havp_update_AV")) {
+ havp_update_AV();
+ }
}
/* Clear havp access log */
if ($_POST['clearlog_x'] != '') {
- file_put_contents(HVDEF_HAVP_ACCESSLOG, '');
+ file_put_contents(HVDEF_HAVP_ACCESSLOG, '');
}
-# ------------------------------------------------------------------------------
+/* ------------------------------------------------------------------------------ */
?>
-$pgtitle