From 64b09a89fda80ec3136f020252d36d1fa0987115 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 29 Aug 2015 21:40:46 +0200 Subject: Delete widget-antivirus.inc Useless. --- config/widget-antivirus/widget-antivirus.inc | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 config/widget-antivirus/widget-antivirus.inc diff --git a/config/widget-antivirus/widget-antivirus.inc b/config/widget-antivirus/widget-antivirus.inc deleted file mode 100644 index 620d8e82..00000000 --- a/config/widget-antivirus/widget-antivirus.inc +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file -- cgit v1.2.3 From 42d5fcf916f0fd0ccbe8a909450f2ff2e2e5b748 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 29 Aug 2015 21:42:26 +0200 Subject: Remove useless deinstall custom_php_deinstall_command --- config/widget-antivirus/widget-antivirus.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/config/widget-antivirus/widget-antivirus.xml b/config/widget-antivirus/widget-antivirus.xml index 91a6a392..0fcd0411 100644 --- a/config/widget-antivirus/widget-antivirus.xml +++ b/config/widget-antivirus/widget-antivirus.xml @@ -44,7 +44,7 @@ Antivirus status widget add-on for HAVP HAVP package widget-antivirus - 0.1.1 + 0.1.2 Widget - Antivirus Status /usr/local/pkg/widget-antivirus.inc @@ -59,7 +59,4 @@ /usr/local/www/widgets/widgets/ https://packages.pfsense.org/packages/config/widget-antivirus/antivirus_status.widget.php - - widget_antivirus_uninstall(); - -- cgit v1.2.3 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(-) 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 From cd8ba1fed5a0c5e305874e61ed550c3a4e684f27 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Sat, 29 Aug 2015 22:05:49 +0200 Subject: EOL at EOF --- config/widget-antivirus/antivirus_status.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/widget-antivirus/antivirus_status.inc b/config/widget-antivirus/antivirus_status.inc index 48c06f9e..be1d6333 100644 --- a/config/widget-antivirus/antivirus_status.inc +++ b/config/widget-antivirus/antivirus_status.inc @@ -4,4 +4,4 @@ $antivirus_status_title = "Antivirus Status"; $antivirus_status_title_link = ""; -?> \ No newline at end of file +?> -- cgit v1.2.3 From 6a6d18ffb4f70d42ac56f1118a1d9506680687d6 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Thu, 3 Sep 2015 05:22:58 +0200 Subject: Remove deleted file references --- config/widget-antivirus/widget-antivirus.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/config/widget-antivirus/widget-antivirus.xml b/config/widget-antivirus/widget-antivirus.xml index 0fcd0411..8a18c2bb 100644 --- a/config/widget-antivirus/widget-antivirus.xml +++ b/config/widget-antivirus/widget-antivirus.xml @@ -46,11 +46,6 @@ widget-antivirus 0.1.2 Widget - Antivirus Status - /usr/local/pkg/widget-antivirus.inc - - /usr/local/pkg/ - https://packages.pfsense.org/packages/config/widget-antivirus/widget-antivirus.inc - /usr/local/www/widgets/include/ https://packages.pfsense.org/packages/config/widget-antivirus/antivirus_status.inc -- cgit v1.2.3 From 46d07a1d696e32de33537ad41e173333f5c4a602 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 8 Sep 2015 14:39:30 +0200 Subject: use pkg_exec() to check package version for pfSense 2.3 --- config/widget-antivirus/antivirus_status.widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/widget-antivirus/antivirus_status.widget.php b/config/widget-antivirus/antivirus_status.widget.php index 77685c20..82f9a74e 100644 --- a/config/widget-antivirus/antivirus_status.widget.php +++ b/config/widget-antivirus/antivirus_status.widget.php @@ -112,7 +112,7 @@ function dwg_av_statistic() { // Show package version at least, no good quick way to get the PBI version echo "pkg v{$config['installedpackages']['package'][get_pkg_id("havp")]['version']}"; } else { - echo exec("/usr/sbin/pkg info havp | /usr/bin/head -n 1"); + echo pkg_exec("query '%v' havp"); } ?> -- cgit v1.2.3 From efb20df72431546285d3f462cbaf60393eb2f025 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Tue, 8 Sep 2015 14:58:18 +0200 Subject: use pkg_exec() to check package version for pfSense 2.3 --- config/widget-antivirus/antivirus_status.widget.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/widget-antivirus/antivirus_status.widget.php b/config/widget-antivirus/antivirus_status.widget.php index 82f9a74e..f1079ea9 100644 --- a/config/widget-antivirus/antivirus_status.widget.php +++ b/config/widget-antivirus/antivirus_status.widget.php @@ -112,7 +112,8 @@ function dwg_av_statistic() { // Show package version at least, no good quick way to get the PBI version echo "pkg v{$config['installedpackages']['package'][get_pkg_id("havp")]['version']}"; } else { - echo pkg_exec("query '%v' havp"); + pkg_exec("query '%v' havp", $version, $err); + echo $version; } ?> -- cgit v1.2.3