From b826f027192c51b86684a06a572c0aca82cb0a58 Mon Sep 17 00:00:00 2001 From: Marcello Coutinho Date: Tue, 1 Nov 2011 01:47:50 -0200 Subject: pfBlocker - version 0.1.4 changes alias/lists/rules engine and gui --- config/pf-blocker/pfblocker.php | 89 ++++++++++++++++++++++++++--------------- 1 file changed, 57 insertions(+), 32 deletions(-) (limited to 'config/pf-blocker/pfblocker.php') diff --git a/config/pf-blocker/pfblocker.php b/config/pf-blocker/pfblocker.php index f1dd85f5..b6c595ab 100644 --- a/config/pf-blocker/pfblocker.php +++ b/config/pf-blocker/pfblocker.php @@ -1,29 +1,27 @@ "; - print $return; + $file='/usr/local/pkg/pfblocker_aliases/'.$pfb.'.txt'; + if ($file) + $return= file_get_contents($file); + print $return; } # to be uncomented when this packages gets stable state #if($_SERVER['REMOTE_ADDR']== '127.0.0.1'){ -switch ($_REQUEST['pfb']){ - case "in": - get_networks(1); - break; - case "out": - get_networks(2); - break; - case "white": - get_networks(3); - break; -} +if (preg_match("/(\w+)/",$_REQUEST['pfb'],$matches)) + get_networks($matches[1]); #} + +if ($argv[1]=='cron' && preg_match("/\d+/",$argv[2],$matches)){ + #require_once("/etc/inc/util.inc"); + #require_once("/etc/inc/functions.inc"); + #require_once("/etc/inc/etpkg-utils.inc"); + #require_once("/etc/inc/globals.inc"); + #require_once("/etc/inc/filter.inc"); + include "/usr/local/pkg/pfblocker.inc"; + print "id".$argv[2]; + sync_package_pfblocker($argv[2]); + } function pfblocker_get_countries(){ $files= array ( "Africa" => "/usr/local/pkg/Africa_cidr.txt", @@ -123,6 +121,10 @@ $xml= <<General /pkg_edit.php?xml=pfblocker.xml&id=0 + + Lists + /pkg.php?xml=pfblocker_lists.xml + Top Spammers /pkg_edit.php?xml=pfblocker_topspammers.xml&id=0 @@ -166,22 +168,45 @@ $xml= << - Continent {$cont} - listtopic + Continent {$cont} + listtopic + + + Countries + countries + + + Use CTRL + CLICK to unselect countries]]> + + select + + {$options} + + {$total} + - Countries - countries - - - + Action + action + Disabled
+ Select action for countries you have selected in {$cont}

+ Note:
'Deny Inbound' - Will deny access from selected countries to your network.
+ 'Deny Outbound' - Will deny access from your users to countries you selected to block
+ 'Permit Inbound' - Will allow access from selected countries to your network.
+ 'Permit Outbound' - Will allow access from your users to countries you selected to block
+ 'Alias Only' - Will create alias {$cont} with selected countries to help custom rule assignments.
+ 'Disabled' - Will just keep selection and do nothing to selected countries.
]]>
select - {$options} - - {$total} - -
+ + + + + + + + + pfblocker_php_install_command(); @@ -201,4 +226,4 @@ EOF; } } -?> \ No newline at end of file +?> -- cgit v1.2.3