From f56760858bc66b0e8abf4151605cbc0a07ca7698 Mon Sep 17 00:00:00 2001 From: BBcan177 Date: Sun, 7 Dec 2014 23:40:07 -0500 Subject: Code Enhancements --- config/pfblockerng/pfblockerng.widget.php | 48 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 25 deletions(-) (limited to 'config/pfblockerng/pfblockerng.widget.php') diff --git a/config/pfblockerng/pfblockerng.widget.php b/config/pfblockerng/pfblockerng.widget.php index 1486f658..b3ab5703 100644 --- a/config/pfblockerng/pfblockerng.widget.php +++ b/config/pfblockerng/pfblockerng.widget.php @@ -58,7 +58,6 @@ if (isset($_POST['pfblockerngack'])) { header("Location: ../../index.php"); } - // This function will create the counts function pfBlockerNG_get_counts() { global $config, $g, $pfb; @@ -107,6 +106,7 @@ if ("{$pfb['enable']}" == "on") { $dcount = exec("cat {$pfb['denydir']}/*.txt | grep -cv '^#\|^$\|^1\.1\.1\.1'"); $pcount = exec("cat {$pfb['permitdir']}/*.txt | grep -cv '^#\|^$\|^1\.1\.1\.1'"); $mcount = exec("cat {$pfb['matchdir']}/*.txt | grep -cv '^#\|^$\|^1\.1\.1\.1'"); +$ncount = exec("cat {$pfb['nativedir']}/*.txt | grep -cv '^#\|^$\|^1\.1\.1\.1'"); // Collect Number of Suppressed Hosts if (file_exists("{$pfb['supptxt']}")) { @@ -118,7 +118,7 @@ if (file_exists("{$pfb['supptxt']}")) { #check rule count #(label, evaluations,packets total, bytes total, packets in, bytes in,packets out, bytes out) $packets = exec("/sbin/pfctl -s labels", $debug); -if (!empty($packets)) { +if (!empty($debug)) { foreach ($debug as $line) { // Auto-Rules start with 'pfB_', Alias Rules should start with 'pfb_' and exact spelling of Alias Name. $line = str_replace("pfb_","pfB_",$line); @@ -158,9 +158,6 @@ if (isset($_GET['getNewCounts'])) { } } -$out = ""; -$in = ""; - // Report any Failed Downloads $results = array(); $fails = exec("grep $(date +%m/%d/%y) {$pfb['errlog']} | grep 'FAIL'", $results); @@ -171,32 +168,33 @@ $fails = exec("grep $(date +%m/%d/%y) {$pfb['errlog']} | grep 'FAIL'", $results) - - + + - + + + " . $ncount . ""); ?> + + + " . $pfbsupp_cnt . ""); ?> + + -- cgit v1.2.3
        - + " . $dcount . "") ?> - - + + " . $pcount . "") ?> - - + + " . $mcount . ""); ?> - - - " . $pfbsupp_cnt . ""); ?> -       ">  - - -
- - "/> -
- - + +
+ + "/> +
+