aboutsummaryrefslogtreecommitdiffstats
path: root/config/ipblocklist/7/ipblocklist.tmp
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2015-02-05 10:02:24 -0200
committerRenato Botelho <garga@FreeBSD.org>2015-02-05 20:10:15 -0200
commit07cf2c4b20230ddedee1bf9dddc1e7cd407385f5 (patch)
tree44d40561519e0018ad586bb1449e107c9ae431f3 /config/ipblocklist/7/ipblocklist.tmp
parente526e4aa28867b7743b0e76993f5f6bebd15bc1b (diff)
downloadpfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.tar.gz
pfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.tar.bz2
pfsense-packages-07cf2c4b20230ddedee1bf9dddc1e7cd407385f5.zip
Packages repo cleanup:
- Drop support for pfSense < 2 - Remove archive/, old files can be reached using git - Remove old and unused packages - Move stale files from config subdir to a package subdir
Diffstat (limited to 'config/ipblocklist/7/ipblocklist.tmp')
-rwxr-xr-xconfig/ipblocklist/7/ipblocklist.tmp241
1 files changed, 0 insertions, 241 deletions
diff --git a/config/ipblocklist/7/ipblocklist.tmp b/config/ipblocklist/7/ipblocklist.tmp
deleted file mode 100755
index c447df6d..00000000
--- a/config/ipblocklist/7/ipblocklist.tmp
+++ /dev/null
@@ -1,241 +0,0 @@
-<?php
- //Version 3.4
- header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
- header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
- require_once('config.inc');
- require("guiconfig.inc");
- include("head.inc");
-
- //set the config as a global variable
- global $config;
-
- $global_usage = '/usr/local/www/packages/ipblocklist/global_usage';
- //$fh = fopen($global_usage, 'r');
-
- //phpinfo();
-
-if (count($_POST)>0) {
-
- conf_mount_rw();
-
- $ent = array();
-
- if ($_POST['enable'] == 1) {
- //echo "enabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 1;
-
- //Process list by downloading and extracting
-
- $myFile = "lists.txt";
- $myWFile = "wlists.txt";
- $fileContents = file_get_contents($myFile);
- $fileWContents = file_get_contents($myWFile);
- $lines = explode(PHP_EOL, $fileContents);
- $Wlines = explode(PHP_EOL, $fileWContents);
- //Remove DIR lists to eliminate duplates
- exec("/bin/rm -R lists");
- exec("/bin/rm -R Wlists");
- //Process each list URL, Extract, and put in DIR lists
- exec("/bin/mkdir lists");
- exec("/bin/mkdir Wlists");
- foreach ($lines as $line) {
- exec("/usr/bin/fetch -o lists $line");
- $filename = basename($line);
- //Extract list
- exec("/usr/bin/gzip -d lists/$filename");
- }
- foreach ($Wlines as $Wline) {
- exec("/usr/bin/fetch -o Wlists $Wline");
- $Wfilename = basename($Wline);
- //Extract Whitelist
- exec("/usr/bin/gzip -d Wlists/$Wfilename");
- }
- //Prep pfctl
- mwexec("/usr/bin/touch lists/ipfw.ipfw");
- mwexec("/usr/bin/touch Wlists/whitelist");
-
- //Now clear ipfw, and process each list to ipfw commands
- exec("/bin/sh convert-execute.sh");
-
- }
- else {
- //echo "disabled";
- $config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] = 0;
- //Clear Lists
- mwexec("ipfw -f flush");
- mwexec("pfctl -t ipblocklist -T kill");
- mwexec("rm -R /usr/local/www/packages/ipblocklist/lists");
- mwexec("sed -i -e '/ipblocklist/d' /tmp/rules.debug");
- mwexec("pfctl -o basic -f /tmp/rules.debug");
- //Clear errorOUT.txt
- mwexec("rm errorOUT.txt");
-
- }
-
-
- write_config();
- //services_dnsmasq_configure();
- sleep(1);
- $savemsg_dnsb = "IP-Blocklist settings have been saved/updated. ";
- conf_mount_ro();
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<p class="pgtitle"><?=$pgtitle?></p>
-<?php if ($input_errors) print_input_errors($input_errors); ?>
-<?php if ($savemsg) print_info_box($savemsg); ?>
-<form method=POST action="">
-<?php
-if ($config['installedpackages']['ipblocklist_settings']['config'][0]['enable'] == 1) {
- echo "<input name='enable' type='checkbox' value='1' checked>\n";
-}
-else {
- echo "<input name='enable' type='checkbox' value='1'>\n";
-}
-?>
-<?php
-if(isset($_POST['formSubmit']))
- {
-
-
- //if(isset($_POST['formlogging']))
- //{
- // exec("/usr/bin/touch logging");
- //}
- //else
- //{
- // exec("/bin/rm logging");
- //}
-
- }
-?>
-<strong>Enable IP-Blocklist</strong><br><br>
-<?php if ($savemsg_cb) print_info_box($savemsg_cb);
- //if ($output) print_info_box($output,$output2);
- echo($output);
- echo($output2);
- ?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr><td class="tabnavtbl">
-<?php
- $tab_array = array();
- $tab_array[0] = array("IP-Blocklist", true, "ipblocklist.php");
- $tab_array[1] = array("Settings", false, "settings.php");
- $tab_array[2] = array("Whitelist", false, "whitelist.php");
- $tab_array[3] = array("Interfaces", false, "ipblocklist_if.php");
- $tab_array[4] = array("Help", false, "https://doc.pfsense.org/index.php/IP_Blocklist");
- //$tab_array[5] = array("Email", false, "email.php");
- display_top_tabs($tab_array);
-?>
-</form>
-</td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr">Main</td>
-
- </tr>
-
- <tr>
- <td class="listlr" valign="middle">
- <br />
- <center>
- <iframe frameboarder=0 boarder=0 src="ipblocklist_list.php" name="lists" id="lists" width="100%" height="200">
- </iframe>
- </center>
-
-
-
-
-
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr>
- <td >
-
-
- </form>
-
-
-
-
-
- <br/><br/>
- <input type="submit" name="formSubmit" value="Save/Update" />
- </p>
-</form>
-<br/>
-
-
-
-
-</div>
-<?php
- //This input guarantees that a POST is sent
- echo "<input type='hidden' name='zzz' value='required'>";
-?>
-
-</td>
-</tr>
-</table>
- </td>
-
-
- </tr>
-
-
-</table>
-</div>
-<br>
-<u>Usage</u>
- <br/>
- Add direct link to list and press <img src="../../themes/nervecenter/images/icons/icon_plus.gif">
- (Example:
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level1.gz">Level1</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level2.gz">Level2</a>,
- <a href="http://iblocklist.whitacrecomputers.com/files/bt_level3.gz">Level3</a>)
- <br/>
- Compressed lists should have .gz extention and follows PeerBlock syntax
- <?php
- echo "<br/><br/>Current Status = ";
- ob_start();
- $results = exec("/sbin/pfctl -s rules | grep -c ipblocklist");
- ob_end_clean();
- if ($results > '2') echo "Running";
- else
- echo "<span style='color:red'>NOT running</span>";
-
- //Get Errors if exists
- ob_start();
- $results = exec("/usr/bin/tail -r errorOUT.txt");
- ob_end_clean();
- echo "<br/><span style='color:red'>";
- echo $results;
- echo "</span>";
-
- //Get IP Count
- echo "<br>You are blocking ";
- ob_start();
- $results = exec("/sbin/pfctl -T show -t ipblocklist |grep -v -c Z");
- ob_end_clean();
- echo $results;
- echo " Networks/IPs";
- ?>
-<br><br>
-<small>Created by <a href="http://www.tomschaefer.org/pfsense">TomSchaefer</a></small>
-<br /><small><a href="http://www.iblocklist.com/">I-Blocklist.com</a></small>
-<!--<input type="submit" value="Save/Update"><br><br>
---><p>
-</p>
-</td>
- </tr>
-</table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
-