summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-12-09 12:45:16 +0000
committerErmal Luçi <eri@pfsense.org>2009-12-09 12:45:16 +0000
commit712b72d7c7f20ffcc8b1fd01fd8af5052074dbf9 (patch)
tree332fc31eb4150af602fe445277715a8e73757b1c
parent984c64a43ba1ea8735175a6adb37eddaa2e3f88c (diff)
downloadpfsense-712b72d7c7f20ffcc8b1fd01fd8af5052074dbf9.zip
pfsense-712b72d7c7f20ffcc8b1fd01fd8af5052074dbf9.tar.gz
Add listtopic and note that only ip addresses may be imported.
-rwxr-xr-xusr/local/www/firewall_aliases_edit.php2
-rwxr-xr-xusr/local/www/firewall_aliases_import.php15
2 files changed, 14 insertions, 3 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php
index c90e34d..b45f736 100755
--- a/usr/local/www/firewall_aliases_edit.php
+++ b/usr/local/www/firewall_aliases_edit.php
@@ -255,7 +255,7 @@ if ($_POST) {
if (!alias_same_type($_POST["address{$x}"], $_POST['type']))
$wrongaliases .= " " . $_POST["address{$x}"];
} else if ($_POST['type'] == "port") {
- if (!is_port($_POST["address{$x}"])
+ if (!is_port($_POST["address{$x}"]))
$input_errors[] = $_POST["address{$x}"] . " is not a valid port alias.";
} else if ($_POST['type'] == "host" || $_POST['type'] == "network") {
if (!is_ipaddr($_POST["address{$x}"]) && !is_hostname($_POST["address{$x}"]))
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php
index 18c797d..1700a20 100755
--- a/usr/local/www/firewall_aliases_import.php
+++ b/usr/local/www/firewall_aliases_import.php
@@ -87,6 +87,14 @@ if($_POST['aliasimport'] <> "") {
}
}
+ if ($_POST['aliasimport']) {
+ $toimport = split("\n", $_POST['aliasimport']);
+ foreach ($toimport as $impip) {
+ if (!is_ipaddr(trim($impip)))
+ $input_errors[] = "$impip is not an ip address. Please correct the error to continue";
+ }
+ }
+
if (!$input_errors) {
$alias = array();
$alias['address'] = str_replace("\n", " ", $_POST['aliasimport']);
@@ -113,6 +121,9 @@ include("head.inc");
<div id="inputerrors"></div>
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
+ <td colspan="2" valign="top" class="listtopic">Alias Import</td>
+ </tr>
+ <tr>
<td valign="top" class="vncellreq">Alias Name</td>
<td class="vtable"> <input name="name" type="text" class="formfld unknown" id="name" size="40" value="<?=htmlspecialchars($_POST['name']);?>" />
<br /> <span class="vexpl">
@@ -127,7 +138,8 @@ include("head.inc");
<tr>
<td valign="top" class="vncellreq">Aliases to import</td>
<td class="vtable"><textarea name="aliasimport" ROWS="15" COLS="40"><?php echo $_POST['aliasimport']; ?></textarea>
- <br /> <span class="vexpl">Paste in the aliases to import seperated by a carriage return. Common examples are list of ips, networks, blacklists, etc.</span></td>
+ <br /> <span class="vexpl">Paste in the aliases to import seperated by a carriage return. Common examples are list of ips, networks, blacklists, etc.
+ <br /> The list may contain only ip addresses. </span></td>
</tr>
<tr>
<td width="22%" valign="top">&nbsp;</td>
@@ -151,4 +163,3 @@ include("head.inc");
</body>
</html>
-
OpenPOWER on IntegriCloud