From 8dc0377748bdfb45d9cdf180ead3f4f5c63e670c Mon Sep 17 00:00:00 2001 From: marcelloc Date: Fri, 28 Oct 2011 17:24:44 -0200 Subject: pfBlocker - version 0.1.2 with widget and more fixes --- config/pf-blocker/pfBlocker.widget.php | 81 ++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 config/pf-blocker/pfBlocker.widget.php (limited to 'config/pf-blocker/pfBlocker.widget.php') diff --git a/config/pf-blocker/pfBlocker.widget.php b/config/pf-blocker/pfBlocker.widget.php new file mode 100644 index 00000000..ec1d08a2 --- /dev/null +++ b/config/pf-blocker/pfBlocker.widget.php @@ -0,0 +1,81 @@ +"; + +$in=""; +$out=""; +$white=""; +$rules=$config['filter']['rule']; +#echo "
";
+foreach($rules as $rule){
+	if ($rule['destination']['address'] == 'pfBlockerOutbound' && $out == ""){
+		#print_r($rule);
+		$out="";
+	}
+		
+	if ($rule['source']['address']== 'pfBlockerInbound' && $in == "")
+		$in="";
+		
+	if ($rule['source']['address']== 'pfBlockerWL' && $white == "")
+		$white="";
+		
+	if ($rule['destination']['address']== 'pfBlockerWL' && $white == "")
+		$white="";
+}
+
+$in=($in != ""?$in:"");
+$out=($out != ""?$out:"");
+$white=($white != ""?$white:"");
+
+echo "    pfBlockerInbound".$in."";
+echo "    pfBlockerOutbound".$out."";
+echo "    pfBlockerWL".$white."";
+
+echo"  ";
+echo"  ";
+if (file_exists("/usr/local/pkg/pfb_in.txt")) {
+         $resultsIP = preg_match_all("/\//",file_get_contents("/usr/local/pkg/pfb_in.txt"),$matches);
+         echo "    ". count($matches[0])." Networks";
+}
+if (file_exists("/usr/local/pkg/pfb_out.txt")) {
+         $resultsIP = preg_match_all("/\//",file_get_contents("/usr/local/pkg/pfb_out.txt"),$matches);
+         echo "    " . count($matches[0])." Networks";
+}
+if (file_exists("/usr/local/pkg/pfb_w.txt")) {
+         $resultsIP = preg_match_all("/\//",file_get_contents("/usr/local/pkg/pfb_w.txt"),$matches);
+         echo "    " . count($matches[0])." Networks";}
+
+echo"  ";
+echo"";
+?>
\ No newline at end of file
-- 
cgit v1.2.3