From 939869231e32f7daca780e92fab9c408f042dbae Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 22 Nov 2010 14:16:21 -0500 Subject: Fix line endings. autocrlf is your friend. --- config/ipblocklist/class.phpmailer.tmp | 2 +- config/ipblocklist/email.tmp | 536 ++++++++++++++++---------------- config/ipblocklist/firewall_shaper.tmp | 22 +- config/ipblocklist/index.tmp | 2 +- config/ipblocklist/interfaces.txt | 2 +- config/ipblocklist/ipblocklist_if.tmp | 434 +++++++++++++------------- config/ipblocklist/ipblocklist_list.tmp | 226 +++++++------- config/ipblocklist/manual_add.tmp | 2 +- config/ipblocklist/purge.tmp | 40 +-- config/ipblocklist/purgeip.tmp | 52 ++-- config/ipblocklist/settings.tmp | 396 +++++++++++------------ config/ipblocklist/whitelist.tmp | 350 ++++++++++----------- 12 files changed, 1032 insertions(+), 1032 deletions(-) (limited to 'config/ipblocklist') diff --git a/config/ipblocklist/class.phpmailer.tmp b/config/ipblocklist/class.phpmailer.tmp index afb71b25..a4756c52 100644 --- a/config/ipblocklist/class.phpmailer.tmp +++ b/config/ipblocklist/class.phpmailer.tmp @@ -1906,4 +1906,4 @@ class PHPMailer { } -?> \ No newline at end of file +?> diff --git a/config/ipblocklist/email.tmp b/config/ipblocklist/email.tmp index d5051656..eac104dd 100644 --- a/config/ipblocklist/email.tmp +++ b/config/ipblocklist/email.tmp @@ -1,268 +1,268 @@ -IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!"); - fwrite($fp, $smtp_auth) or die("Couldn't write values to file!"); - fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!"); - fwrite($fp, $smtp_secure) or die("Couldn't write values to file!"); - fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!"); - fwrite($fp, $host) or die("Couldn't write values to file!"); - fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!"); - fwrite($fp, $port) or die("Couldn't write values to file!"); - fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!"); - fwrite($fp, $user); - fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!"); - fwrite($fp, $pass); - fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!"); - fwrite($fp, $from) or die("Couldn't write values to file!"); - fwrite($fp, "\",\"pfsense ipblocklist\");\n\$mail->From = \"") or die("Couldn't write values to file!"); - fwrite($fp, $from) or die("Couldn't write values to file!"); - fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"IP-Blocklist encountered an event. A system log entry was made with details of event\";\n\$body .= \"

\" . date('l jS \of F Y h:i:s A') . \"

Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c ipblocklist\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"Restarting\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt\");\nob_end_clean();\n\$body .= \"
\";\n\$body .= \$results;\n\$body .= \"\";\n\$body .= \"
You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t ipblocklist |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!"); - fwrite($fp, $to) or die("Couldn't write values to file!"); - fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!"); - fwrite($fp, $html) or die("Couldn't write values to file!"); - fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - Go Back\";\n}\n?>") or die("Couldn't write values to file!"); - fclose($fp); - //echo "Saved successfully!"; - - exec("rm email_config.html"); - exec("touch email_config.html"); - $file2 = "email_config.html"; - $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!"); - fwrite($fp2, " - - ") or die("Couldn't write values to file!"); - if ($smtp_auth=="true") - fwrite($fp2, "") or die("Couldn't write values to file!"); - else - fwrite($fp2, "") or die("Couldn't write values to file!"); - fwrite($fp2, " - - ") or die("Couldn't write values to file!"); - if ($smtp_secure=="ssl") - fwrite($fp2, "") or die("Couldn't write values to file!"); - else - fwrite($fp2, "") or die("Couldn't write values to file!"); - fwrite($fp2, " - - - - - - - - - - - - - - - - - - ") or die("Couldn't write values to file!"); - if ($html=="true") - fwrite($fp2, "") or die("Couldn't write values to file!"); - else - fwrite($fp2, "") or die("Couldn't write values to file!"); - fwrite($fp2, " - - - - - - - - - - - - -
SMTP Auth
SMTP Security
Host
Port
Username
Password
Use HTML formatting
From email address
To email address
Subject
-
- -") or die("Couldn't write values to file!"); - fclose($fp2); -} -if (isset($_GET['test'])) { - echo ''; -} -if (isset($_GET['reset'])) { - exec ("rm email_send.php"); - exec ("rm email_config.html"); - echo ''; -} -?> - - - - - - - - -

- - -

- - - - - - - - - -
- -
-
- - - - - - - - - -
Email Settings for SMTP mail
- - - - - -Your settings have already been set. Would you like to overwrite your email settings?

\n"; - $content = file_get_contents('email_config.html'); - echo $content; - echo "

\n"; - echo "\n"; - echo "

\n"; - echo "\n"; -} else { - echo "
\n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - echo "
SMTP Auth
SMTP Security
Host
Port
Username
Password
Use HTML formatting
From email address
To email address
Subject
\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; -} -?> - - - - -
-
- -
- - -

- -

-

- - - - - - - +IsSMTP();\n\$mail->SMTPAuth = ") or die("Couldn't write values to file!"); + fwrite($fp, $smtp_auth) or die("Couldn't write values to file!"); + fwrite($fp, ";\n\$mail->SMTPSecure = \"") or die("Couldn't write values to file!"); + fwrite($fp, $smtp_secure) or die("Couldn't write values to file!"); + fwrite($fp, "\";\n\$mail->Host = \"") or die("Couldn't write values to file!"); + fwrite($fp, $host) or die("Couldn't write values to file!"); + fwrite($fp, "\";\n\$mail->Port = ") or die("Couldn't write values to file!"); + fwrite($fp, $port) or die("Couldn't write values to file!"); + fwrite($fp, ";\n\$mail->Username = \"") or die("Couldn't write values to file!"); + fwrite($fp, $user); + fwrite($fp, "\";\n\$mail->Password = \"") or die("Couldn't write values to file!"); + fwrite($fp, $pass); + fwrite($fp, "\";\n\$mail->AddReplyTo(\"") or die("Couldn't write values to file!"); + fwrite($fp, $from) or die("Couldn't write values to file!"); + fwrite($fp, "\",\"pfsense ipblocklist\");\n\$mail->From = \"") or die("Couldn't write values to file!"); + fwrite($fp, $from) or die("Couldn't write values to file!"); + fwrite($fp, "\";\n\$mail->Subject = \"" . $subject . "\";\n\$mail->AltBody = \"To view the message, please use an HTML compatible email viewer!\";\n\$mail->WordWrap = 50;\n\$body = \"IP-Blocklist encountered an event. A system log entry was made with details of event\";\n\$body .= \"

\" . date('l jS \of F Y h:i:s A') . \"

Current Status = \";\nob_start();\n\$results = exec(\"pfctl -s rules | grep -c ipblocklist\");\nob_end_clean();\nif (\$results > '0')\n\$body .= \"Running\";\nelse\n\$body .= \"Restarting\";\nob_start();\n\$results = exec(\"tail -r /usr/local/www/packages/ipblocklist/errorOUT.txt\");\nob_end_clean();\n\$body .= \"
\";\n\$body .= \$results;\n\$body .= \"\";\n\$body .= \"
You are blocking \";\nob_start();\n\$results = exec(\"pfctl -T show -t ipblocklist |grep -v -c Z\");\nob_end_clean();\n\$body .= \$results;\n\$body .= \" Networks\";\n\n\$mail->MsgHTML(\$body);\n\$mail->AddAddress(\"") or die("Couldn't write values to file!"); + fwrite($fp, $to) or die("Couldn't write values to file!"); + fwrite($fp, "\");\n\$mail->IsHTML(") or die("Couldn't write values to file!"); + fwrite($fp, $html) or die("Couldn't write values to file!"); + fwrite($fp, ");\n\nif(!\$mail->Send()) {\n echo \"Mailer Error: \" . \$mail->ErrorInfo;\n} else {\n echo \"Message sent! - Go Back\";\n}\n?>") or die("Couldn't write values to file!"); + fclose($fp); + //echo "Saved successfully!"; + + exec("rm email_config.html"); + exec("touch email_config.html"); + $file2 = "email_config.html"; + $fp2 = fopen($file2, "w") or die("Couldn't open $file for writing!"); + fwrite($fp2, " + + ") or die("Couldn't write values to file!"); + if ($smtp_auth=="true") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " + + ") or die("Couldn't write values to file!"); + if ($smtp_secure=="ssl") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " + + + + + + + + + + + + + + + + + + ") or die("Couldn't write values to file!"); + if ($html=="true") + fwrite($fp2, "") or die("Couldn't write values to file!"); + else + fwrite($fp2, "") or die("Couldn't write values to file!"); + fwrite($fp2, " + + + + + + + + + + + + +
SMTP Auth
SMTP Security
Host
Port
Username
Password
Use HTML formatting
From email address
To email address
Subject
+
+ +") or die("Couldn't write values to file!"); + fclose($fp2); +} +if (isset($_GET['test'])) { + echo ''; +} +if (isset($_GET['reset'])) { + exec ("rm email_send.php"); + exec ("rm email_config.html"); + echo ''; +} +?> + + + + + + + + +

+ + +

+ + + + + + + + + +
+ +
+
+ + + + + + + + + +
Email Settings for SMTP mail
+ + + + + +Your settings have already been set. Would you like to overwrite your email settings?

\n"; + $content = file_get_contents('email_config.html'); + echo $content; + echo "

\n"; + echo "\n"; + echo "

\n"; + echo "\n"; +} else { + echo "
\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "
SMTP Auth
SMTP Security
Host
Port
Username
Password
Use HTML formatting
From email address
To email address
Subject
\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; +} +?> + + + + +
+
+ +
+ + +

+ +

+

+ + + + + + + diff --git a/config/ipblocklist/firewall_shaper.tmp b/config/ipblocklist/firewall_shaper.tmp index 10e921b4..833f87f8 100644 --- a/config/ipblocklist/firewall_shaper.tmp +++ b/config/ipblocklist/firewall_shaper.tmp @@ -1,11 +1,11 @@ - - - - - - - \ No newline at end of file + + + + + + + diff --git a/config/ipblocklist/index.tmp b/config/ipblocklist/index.tmp index 7c768af6..bcbfad8f 100755 --- a/config/ipblocklist/index.tmp +++ b/config/ipblocklist/index.tmp @@ -8,4 +8,4 @@ window.parent.location="../../index.php"; - \ No newline at end of file + diff --git a/config/ipblocklist/interfaces.txt b/config/ipblocklist/interfaces.txt index 124009d7..faba42a4 100644 --- a/config/ipblocklist/interfaces.txt +++ b/config/ipblocklist/interfaces.txt @@ -1 +1 @@ -any \ No newline at end of file +any diff --git a/config/ipblocklist/ipblocklist_if.tmp b/config/ipblocklist/ipblocklist_if.tmp index 364133c8..69cad86e 100644 --- a/config/ipblocklist/ipblocklist_if.tmp +++ b/config/ipblocklist/ipblocklist_if.tmp @@ -1,217 +1,217 @@ -. - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. -*/ - -//$pgtitle = "Firewall: Countryblock - Interfaces"; -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("guiconfig.inc"); - -/* - In this file, "port" refers to the physical port name, - while "interface" refers to LAN, WAN, or OPTn. -*/ - -/* get list without VLAN interfaces */ -$portlist = get_interface_list(); - -/* add VLAN interfaces */ -if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { - $i = 0; - foreach ($config['vlans']['vlan'] as $vlan) { - $portlist['vlan' . $i] = $vlan; - $portlist['vlan' . $i]['isvlan'] = true; - $i++; - } -} - -if ($_POST) { - - unset($input_errors); - - /* input validation */ - - /* Build a list of the port names so we can see how the interfaces map */ - $portifmap = array(); - foreach ($portlist as $portname => $portinfo) { - $portifmap[$portname] = array(); - //echo($portname . "done"); - } - - /* Go through the list of ports selected by the user, - build a list of port-to-interface mappings in portifmap */ - conf_mount_rw(); - $myFile = "interfaces.txt"; - - $fh = fopen($myFile, 'w+'); - - - foreach ($_POST as $ifname => $ifport) { - //echo $ifname; - //echo "
"; - if ($ifname != "__csrf_magic"){ - fwrite($fh, $ifname . "\n"); - } - else { - } - //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt')) - //$portifmap[$ifport][] = strtoupper($ifname); - } - - conf_mount_ro(); - - - if (!$input_errors) { - /* No errors detected, so update the config */ - foreach ($_POST as $ifname => $ifport) { - - if (($ifname == 'lan') || ($ifname == 'wan') || - (substr($ifname, 0, 3) == 'opt')) { - - - } - } - - $savemsg = get_std_save_message($retval); - - - - } -} - - - - - - -include("head.inc"); - - - -?> - - - -

- -Here to go back"); ?> -
-

- - - - - -
- -
-
- - - - - - - $iface): - if ($iface['descr']) - $ifdescr = $iface['descr']; - else - $ifdescr = strtoupper($ifname); - ?> - - - - - - - - - - - -
InterfaceSelected 
- - - - - $portinfo): ?> - - $portname"; - else - echo "$portname"; - } - ?> - - - - -
-
-


- -

-

Select the interfaces you want secured. It's recommended to select all interfaces.

-

Default: All interfaces are seleted.
-
-

-

-
- - - - - - - +. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. +*/ + +//$pgtitle = "Firewall: Countryblock - Interfaces"; +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("guiconfig.inc"); + +/* + In this file, "port" refers to the physical port name, + while "interface" refers to LAN, WAN, or OPTn. +*/ + +/* get list without VLAN interfaces */ +$portlist = get_interface_list(); + +/* add VLAN interfaces */ +if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { + $i = 0; + foreach ($config['vlans']['vlan'] as $vlan) { + $portlist['vlan' . $i] = $vlan; + $portlist['vlan' . $i]['isvlan'] = true; + $i++; + } +} + +if ($_POST) { + + unset($input_errors); + + /* input validation */ + + /* Build a list of the port names so we can see how the interfaces map */ + $portifmap = array(); + foreach ($portlist as $portname => $portinfo) { + $portifmap[$portname] = array(); + //echo($portname . "done"); + } + + /* Go through the list of ports selected by the user, + build a list of port-to-interface mappings in portifmap */ + conf_mount_rw(); + $myFile = "interfaces.txt"; + + $fh = fopen($myFile, 'w+'); + + + foreach ($_POST as $ifname => $ifport) { + //echo $ifname; + //echo "
"; + if ($ifname != "__csrf_magic"){ + fwrite($fh, $ifname . "\n"); + } + else { + } + //if (($ifname == 'lan') || ($ifname == 'wan') || (substr($ifname, 0, 3) == 'opt')) + //$portifmap[$ifport][] = strtoupper($ifname); + } + + conf_mount_ro(); + + + if (!$input_errors) { + /* No errors detected, so update the config */ + foreach ($_POST as $ifname => $ifport) { + + if (($ifname == 'lan') || ($ifname == 'wan') || + (substr($ifname, 0, 3) == 'opt')) { + + + } + } + + $savemsg = get_std_save_message($retval); + + + + } +} + + + + + + +include("head.inc"); + + + +?> + + + +

+ +Here to go back"); ?> +
+

+ + + + + +
+ +
+
+ + + + + + + $iface): + if ($iface['descr']) + $ifdescr = $iface['descr']; + else + $ifdescr = strtoupper($ifname); + ?> + + + + + + + + + + + +
InterfaceSelected 
+ + + + + $portinfo): ?> + + $portname"; + else + echo "$portname"; + } + ?> + + + + +
+
+


+ +

+

Select the interfaces you want secured. It's recommended to select all interfaces.

+

Default: All interfaces are seleted.
+
+

+

+
+ + + + + + + diff --git a/config/ipblocklist/ipblocklist_list.tmp b/config/ipblocklist/ipblocklist_list.tmp index 2ea5a68b..0603d4ce 100644 --- a/config/ipblocklist/ipblocklist_list.tmp +++ b/config/ipblocklist/ipblocklist_list.tmp @@ -1,113 +1,113 @@ -\"Whitelist\"\n"; -echo "Add List URL:
\n"; -echo "\n"; -echo "\n"; -echo "Purge All\n"; -echo "\n"; - -function delLineFromFile($fileName, $lineNum){ -// check the file exists - if(!is_writable($fileName)) - { - // print an error - print "The file $fileName is not writable"; - // exit the function - exit; - } - else - { - // read the file into an array - $arr = file($fileName); - } - - // the line to delete is the line number minus 1, because arrays begin at zero - $lineToDelete = $lineNum-1; - - // check if the line to delete is greater than the length of the file - if($lineToDelete > sizeof($arr)) - { - // print an error - print "You have chosen a line number, [$lineNum], higher than the length of the file."; - // exit the function - exit; - } - - //remove the line - unset($arr["$lineToDelete"]); - - // open the file for reading - if (!$fp = fopen($fileName, 'w+')) - { - // print an error - print "Cannot open file ($fileName)"; - // exit the function - exit; - } - - // if $fp is valid - if($fp) - { - // write the array to the file - foreach($arr as $line) { fwrite($fp,$line); } - - // close the file - fclose($fp); - } - -echo "done"; -} - - -$myFile = "lists.txt"; -$content = $_REQUEST['content']; -$fh = fopen($myFile, 'a+'); -fwrite($fh, $content); -if (strlen($content) > 1) { - fwrite($fh, "\n"); - } else { -} -fclose($fh); - - -//echo (filesize($myFile)); -if (filesize($myFile) > 1) { - //$fh = fopen($myFile, 'r'); - //$theData = fread($fh, filesize($myFile)); - //fclose($fh); - echo "
Current List(s):
"; - // Get the whole file into a single string - $fileContents = file_get_contents($myFile); - - // Explode the file contents string by each line - $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like - - // Iterate through each line and do what you need with it - - foreach ($lines as $line) { - $i++; - echo ""; - echo " "; - echo $line; - //echo ""; - // echo $i; - echo "
"; - - } - - - //echo $theData; - - -} -echo "

"; - - - - -?> \ No newline at end of file +\"Whitelist\"\n"; +echo "Add List URL: \n"; +echo "\n"; +echo "\n"; +echo "Purge All\n"; +echo "\n"; + +function delLineFromFile($fileName, $lineNum){ +// check the file exists + if(!is_writable($fileName)) + { + // print an error + print "The file $fileName is not writable"; + // exit the function + exit; + } + else + { + // read the file into an array + $arr = file($fileName); + } + + // the line to delete is the line number minus 1, because arrays begin at zero + $lineToDelete = $lineNum-1; + + // check if the line to delete is greater than the length of the file + if($lineToDelete > sizeof($arr)) + { + // print an error + print "You have chosen a line number, [$lineNum], higher than the length of the file."; + // exit the function + exit; + } + + //remove the line + unset($arr["$lineToDelete"]); + + // open the file for reading + if (!$fp = fopen($fileName, 'w+')) + { + // print an error + print "Cannot open file ($fileName)"; + // exit the function + exit; + } + + // if $fp is valid + if($fp) + { + // write the array to the file + foreach($arr as $line) { fwrite($fp,$line); } + + // close the file + fclose($fp); + } + +echo "done"; +} + + +$myFile = "lists.txt"; +$content = $_REQUEST['content']; +$fh = fopen($myFile, 'a+'); +fwrite($fh, $content); +if (strlen($content) > 1) { + fwrite($fh, "\n"); + } else { +} +fclose($fh); + + +//echo (filesize($myFile)); +if (filesize($myFile) > 1) { + //$fh = fopen($myFile, 'r'); + //$theData = fread($fh, filesize($myFile)); + //fclose($fh); + echo "
Current List(s):
"; + // Get the whole file into a single string + $fileContents = file_get_contents($myFile); + + // Explode the file contents string by each line + $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like + + // Iterate through each line and do what you need with it + + foreach ($lines as $line) { + $i++; + echo ""; + echo " "; + echo $line; + //echo ""; + // echo $i; + echo "
"; + + } + + + //echo $theData; + + +} +echo "

"; + + + + +?> diff --git a/config/ipblocklist/manual_add.tmp b/config/ipblocklist/manual_add.tmp index ecf42678..361b782b 100755 --- a/config/ipblocklist/manual_add.tmp +++ b/config/ipblocklist/manual_add.tmp @@ -66,4 +66,4 @@ echo "

"; -?> \ No newline at end of file +?> diff --git a/config/ipblocklist/purge.tmp b/config/ipblocklist/purge.tmp index 6bc8dde9..a5a6cdf8 100644 --- a/config/ipblocklist/purge.tmp +++ b/config/ipblocklist/purge.tmp @@ -1,20 +1,20 @@ - temp_lists.txt"); -if ($line == 0) { - exec("/bin/rm lists.txt"); - } else { - exec("/usr/bin/sed $line'd' lists.txt > temp_lists.txt"); - } -exec("/usr/bin/more temp_lists.txt > lists.txt"); -exec("/bin/rm temp_lists.txt"); - - -header('Location: ipblocklist.php'); - -?> \ No newline at end of file + temp_lists.txt"); +if ($line == 0) { + exec("/bin/rm lists.txt"); + } else { + exec("/usr/bin/sed $line'd' lists.txt > temp_lists.txt"); + } +exec("/usr/bin/more temp_lists.txt > lists.txt"); +exec("/bin/rm temp_lists.txt"); + + +header('Location: ipblocklist.php'); + +?> diff --git a/config/ipblocklist/purgeip.tmp b/config/ipblocklist/purgeip.tmp index 6ce36dfe..b577b8af 100644 --- a/config/ipblocklist/purgeip.tmp +++ b/config/ipblocklist/purgeip.tmp @@ -1,26 +1,26 @@ - temp_ips.ipfw"); -if ($line == 0) { - exec("rm wlists.txt"); - } else { - exec("sed $line'd' wlists.txt > temp_wlists.txt"); - } -exec("more temp_wlists.txt > wlists.txt"); -exec("rm temp_wlists.txt"); - - -?> - - - - - - - \ No newline at end of file + temp_ips.ipfw"); +if ($line == 0) { + exec("rm wlists.txt"); + } else { + exec("sed $line'd' wlists.txt > temp_wlists.txt"); + } +exec("more temp_wlists.txt > wlists.txt"); +exec("rm temp_wlists.txt"); + + +?> + + + + + + + diff --git a/config/ipblocklist/settings.tmp b/config/ipblocklist/settings.tmp index 37acc2a0..e27d22ac 100644 --- a/config/ipblocklist/settings.tmp +++ b/config/ipblocklist/settings.tmp @@ -1,198 +1,198 @@ - - - - - -
- - - - - -

- - - - - -
- - -
-
- - - - - - - - - - - - - -
Settings
- -"; - exec("touch OUTBOUND"); - } - else - { - $output2 = " and Outbound access is ALLOWED."; - exec("rm OUTBOUND"); - } - - if(isset($_POST['formlogging'])) - { - exec("touch logging"); - } - else - { - exec("rm logging"); - } - - - - - } -conf_mount_ro(); -?> - - - - - - - - - - - - -
- - - - -
-

- Warning! No Interfaces Selected Click if"; - } - - ?> -

- - -

- Block outbound? -"; - } else { - echo ""; - } -?> - -
- Enable Logging?  -"; - } else { - echo ""; - } -?> -
- - - - - - - - -

- -
- - - - -"; -?> - -
-
-
-
-

-

-

-
- - - - - + + + + + +
+ + +
+ + +

+ + + + + +
+ + +
+
+ + + + + + + + + + + + + +
Settings
+ +"; + exec("touch OUTBOUND"); + } + else + { + $output2 = " and Outbound access is ALLOWED."; + exec("rm OUTBOUND"); + } + + if(isset($_POST['formlogging'])) + { + exec("touch logging"); + } + else + { + exec("rm logging"); + } + + + + + } +conf_mount_ro(); +?> + + + + + + + + + + + + +
+ + + + +
+

+ Warning! No Interfaces Selected Click if"; + } + + ?> +

+ + +

+ Block outbound? +"; + } else { + echo ""; + } +?> + +
+ Enable Logging?  +"; + } else { + echo ""; + } +?> +
+ + + + + + + + +

+ +
+ + + + +"; +?> + +
+
+
+
+

+

+

+
+ + + + + diff --git a/config/ipblocklist/whitelist.tmp b/config/ipblocklist/whitelist.tmp index e45cf2dd..98745fa2 100644 --- a/config/ipblocklist/whitelist.tmp +++ b/config/ipblocklist/whitelist.tmp @@ -1,175 +1,175 @@ - - - - -

- - -
- -

- - - - - -
- -
-
- - - - - - - - - - - - - -
Whitelist
- - - - -White lists - The lists added here will be added to a whitelist -
Add List URL: - -

- - -Purge All - - - - - 1) { - fwrite($fh, "\n"); - } else { -} -fclose($fh); - - -//echo (filesize($myFile)); -if (filesize($myFile) > 1) { - //$fh = fopen($myFile, 'r'); - //$theData = fread($fh, filesize($myFile)); - //fclose($fh); - echo "
Current List(s):
"; - // Get the whole file into a single string - $fileContents = file_get_contents($myFile); - - // Explode the file contents string by each line - $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like - - // Iterate through each line and do what you need with it - - foreach ($lines as $line) { - $i++; - echo ""; - echo " "; - echo $line; - //echo ""; - // echo $i; - echo "
"; - - } - - - //echo $theData; - - -} -echo "

"; - - - - -?>

- - - - - - - - - - -
-
- -
-

Usage -
- Add direct link to list and press - (Example: - Level1, - Level2, - Level3) -
- Compressed lists should have .gz extention and follows PeerBlock syntax
-
-

-
- -

- -

-

-
- - - - - + + + + +

+ + +
+ +

+ + + + + +
+ +
+
+ + + + + + + + + + + + + +
Whitelist
+ + + + +White lists - The lists added here will be added to a whitelist +
Add List URL: + +

+ + +Purge All + + + + + 1) { + fwrite($fh, "\n"); + } else { +} +fclose($fh); + + +//echo (filesize($myFile)); +if (filesize($myFile) > 1) { + //$fh = fopen($myFile, 'r'); + //$theData = fread($fh, filesize($myFile)); + //fclose($fh); + echo "
Current List(s):
"; + // Get the whole file into a single string + $fileContents = file_get_contents($myFile); + + // Explode the file contents string by each line + $lines = explode(PHP_EOL, $fileContents); // Replace PHP_EOL with "\r\n" or "\n" or "\r" if you like + + // Iterate through each line and do what you need with it + + foreach ($lines as $line) { + $i++; + echo ""; + echo " "; + echo $line; + //echo ""; + // echo $i; + echo "
"; + + } + + + //echo $theData; + + +} +echo "

"; + + + + +?>

+ + + + + + + + + + +
+
+ +
+

Usage +
+ Add direct link to list and press + (Example: + Level1, + Level2, + Level3) +
+ Compressed lists should have .gz extention and follows PeerBlock syntax
+
+

+
+ +

+ +

+

+
+ + + + + -- cgit v1.2.3