From 712b72d7c7f20ffcc8b1fd01fd8af5052074dbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Wed, 9 Dec 2009 12:45:16 +0000 Subject: Add listtopic and note that only ip addresses may be imported. --- usr/local/www/firewall_aliases_edit.php | 2 +- usr/local/www/firewall_aliases_import.php | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'usr/local/www') 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");
+ + + +
Paste in the aliases to import seperated by a carriage return. Common examples are list of ips, networks, blacklists, etc. +
The list may contain only ip addresses.
@@ -151,4 +163,3 @@ include("head.inc"); - -- cgit v1.1
Alias Import
Alias Name
@@ -127,7 +138,8 @@ include("head.inc");
Aliases to import -
Paste in the aliases to import seperated by a carriage return. Common examples are list of ips, networks, blacklists, etc.