diff options
Diffstat (limited to 'config/countryblock')
-rw-r--r-- | config/countryblock/countryblock.inc | 8 | ||||
-rw-r--r-- | config/countryblock/countryblock.tmp | 46 | ||||
-rw-r--r-- | config/countryblock/countryblock.xml | 14 | ||||
-rw-r--r-- | config/countryblock/execute.sh | 6 |
4 files changed, 54 insertions, 20 deletions
diff --git a/config/countryblock/countryblock.inc b/config/countryblock/countryblock.inc index 39a22243..1f94dff1 100644 --- a/config/countryblock/countryblock.inc +++ b/config/countryblock/countryblock.inc @@ -72,10 +72,14 @@ function php_install_command() unlink_if_exists("/tmp/ddaccordion.js"); exec("cp /tmp/public_smo_scripts.js /usr/local/www/packages/countryblock/public_smo_scripts.js"); unlink_if_exists("/tmp/public_smo_scripts.js"); - exec("cp /tmp/titlebar.png /usr/local/www/packages/countryblock/titlebar.pngs"); + exec("cp /tmp/titlebar.png /usr/local/www/packages/countryblock/titlebar.png"); unlink_if_exists("/tmp/titlebar.png"); exec("cp /tmp/titlebar-active.png /usr/local/www/packages/countryblock/titlebar-active.png"); unlink_if_exists("/tmp/titlebar-active.png"); + exec("cp /tmp/purge.tmp /usr/local/www/packages/countryblock/purge.php"); + unlink_if_exists("/tmp/purge.tmp"); + exec("cp /tmp/whitelist.tmp /usr/local/www/packages/countryblock/whitelist.php"); + unlink_if_exists("/tmp/whitelist.tmp"); @@ -99,4 +103,4 @@ function deinstall_command() conf_mount_ro(); } -?>
\ No newline at end of file +?> diff --git a/config/countryblock/countryblock.tmp b/config/countryblock/countryblock.tmp index 6c080c06..dff73e11 100644 --- a/config/countryblock/countryblock.tmp +++ b/config/countryblock/countryblock.tmp @@ -74,8 +74,16 @@ if (count($_POST)>0) { conf_mount_ro(); } ?> - +<head> <?php include("fbegin.inc"); ?> +<style type="text/css"> +<!-- +.white { + text-align: center; +} +--> +</style> + <p class="pgtitle">Firewall: Country Block</p> <form method=POST action=""> @@ -135,7 +143,7 @@ mwexec("touch countries.txt"); } } ?> -<head> + <script type="text/javascript" src="jquery.min.js"></script> @@ -179,6 +187,8 @@ ddaccordion.init({ <style type="text/css"> +a img {border:none; } + .arrowlistmenu{ width: 180px; /*width of accordion menu*/ } @@ -251,12 +261,19 @@ background-color: #F3F3F3; <form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post"> <p> - Check the country that you would like to block completely.<br/> - - - - </p> - + Check the country that you would like to block completely. Currently + <?php + $countfile = "countries.txt"; + if (file_exists($countfile)) { + $countlines = count(file($countfile)); + echo "$countlines"; + } else { + echo "0 "; + } + + ?> + + of 245 selected. <a href="whitelist.php" target="_parent"><img src="../../themes/nervecenter/images/icons/icon_plus.gif" ALT="Manual" ALIGN=RIGHT></a></p> <p> Block outbound? <?php @@ -270,8 +287,7 @@ background-color: #F3F3F3; <input type="checkbox" name="checkall" onclick="checkUncheckAll(this);"/>select/unselect </p> - - <br/> +<br/> <table style="width: 50%"> @@ -588,7 +604,7 @@ ob_end_clean(); echo "<li><input name='formCountry[]' type='checkbox' value='BT' checked/>Bhutan</li>"; else echo "<li><input name='formCountry[]' type='checkbox' value='BT' />Bhutan</li>"; - +/* ob_start(); $results = exec("cat countries.txt | grep XA"); ob_end_clean(); @@ -596,7 +612,7 @@ ob_end_clean(); echo "<li><input name='formCountry[]' type='checkbox' value='XA' checked/>Bogons</li>"; else echo "<li><input name='formCountry[]' type='checkbox' value='XA' />Bogons</li>"; - +*/ ob_start(); $results = exec("cat countries.txt | grep BO"); ob_end_clean(); @@ -2534,8 +2550,8 @@ ob_end_clean(); <br/><span style="color:red">Warning!</span> - Apply after every firewall change or state reset. Use at your own risk. <br/><br/> <input type="submit" name="formSubmit" value="Commit Countries" /> - </form> - <br/> +</form> +<br/> <?php echo "Current Status = "; @@ -2571,4 +2587,4 @@ ob_end_clean(); <?php include("fend.inc"); ?> </body> -</html>
\ No newline at end of file +</html> diff --git a/config/countryblock/countryblock.xml b/config/countryblock/countryblock.xml index 8bb3994d..a4cffe27 100644 --- a/config/countryblock/countryblock.xml +++ b/config/countryblock/countryblock.xml @@ -41,7 +41,7 @@ <requirements>Active Internet</requirements> <faq>http://forum.pfsense.org/index.php/topic,25732.0.html</faq> <name>Country Block Settings</name> - <version>0.1.2</version> + <version>0.1.3</version> <title>Settings</title> <include_file>/usr/local/pkg/countryblock.inc</include_file> <menu> @@ -114,6 +114,16 @@ <chmod>0755</chmod> <item>http://www.pfsense.com/packages/config/countryblock/titlebar-active.png</item> </additional_files_needed> + <additional_files_needed> + <prefix>/tmp/</prefix> + <chmod>0755</chmod> + <item>http://www.pfsense.com/packages/config/countryblock/purge.tmp</item> + </additional_files_needed> + <additional_files_needed> + <prefix>/tmp/</prefix> + <chmod>0755</chmod> + <item>http://www.pfsense.com/packages/config/countryblock/whitelist.tmp</item> + </additional_files_needed> <fields> <field> <fielddescr>Variable One</fielddescr> @@ -142,4 +152,4 @@ <custom_php_deinstall_command> deinstall_command(); </custom_php_deinstall_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/countryblock/execute.sh b/config/countryblock/execute.sh index f109f896..350cd170 100644 --- a/config/countryblock/execute.sh +++ b/config/countryblock/execute.sh @@ -1,3 +1,4 @@ +#!/bin/sh pfctl -t countryblock -T kill sed -i -e '/countryblock/d' /tmp/rules.debug @@ -5,7 +6,7 @@ sed -i -e '/countryblock/d' /tmp/rules.debug #find my line for table export i=`grep -n 'block quick from any to <snort2c>' /tmp/rules.debug | grep -o '[0-9]\{2,4\}'` -export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]'` +export t=`grep -n 'User Aliases' /tmp/rules.debug |grep -o '[0-9]\{1,2\}'` i=$(($i+'1')) t=$(($t+'1')) @@ -44,6 +45,9 @@ while read line echo "" >> /tmp/rules.debug.tmp echo "#countryblock" >> /tmp/rules.debug.tmp echo "table <countryblock> persist file '/usr/local/www/packages/countryblock/lists/countries.txt'" >> /tmp/rules.debug.tmp + echo "table <countryblockW> persist file '/usr/local/www/packages/countryblock/countries-white.txt'" >> /tmp/rules.debug.tmp + echo "pass quick from <countryblockW> to any label 'countryblock'" >> /tmp/rules.debug.tmp + echo "pass quick from any to <countryblockW> label 'countryblock'" >> /tmp/rules.debug.tmp echo "block quick from <countryblock> to any label 'countryblock'" >> /tmp/rules.debug.tmp if [ -f OUTBOUND ]; then echo "block quick from any to <countryblock> label 'countryblock'" >> /tmp/rules.debug.tmp |