diff options
Diffstat (limited to 'usr/local/www/firewall_aliases_import.php')
-rwxr-xr-x | usr/local/www/firewall_aliases_import.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php index 9b9d735..c86a218 100755 --- a/usr/local/www/firewall_aliases_import.php +++ b/usr/local/www/firewall_aliases_import.php @@ -1,7 +1,7 @@ <?php /* $Id$ */ /* - firewall_aliases_edit.php + firewall_aliases_import.php Copyright (C) 2005 Scott Ullrich All rights reserved. @@ -38,7 +38,8 @@ ##|-PRIV -$reserved_keywords = array("pass", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec"); +// Keywords not allowed in names +$reserved_keywords = array("all", "pass", "block", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec"); require("guiconfig.inc"); require_once("util.inc"); @@ -47,8 +48,13 @@ require("shaper.inc"); $pgtitle = array(gettext("Firewall"),gettext("Aliases"),gettext("Bulk import")); +// Add all Load balance names to reserved_keywords +if (is_array($config['load_balancer']['lbpool'])) + foreach ($config['load_balancer']['lbpool'] as $lbpool) + $reserved_keywords[] = $lbpool['name']; + $reserved_ifs = get_configured_interface_list(false, true); -$reserved_keywords = array_merge($reserved_keywords, $reserved_ifs); +$reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_table_names); if (!is_array($config['aliases']['alias'])) $config['aliases']['alias'] = array(); @@ -89,7 +95,7 @@ if($_POST['aliasimport'] <> "") { if (is_iprange($impip)) { list($startip, $endip) = explode('-', $impip); $rangesubnets = ip_range_to_subnet_array($startip, $endip); - $address .= implode(" ", $rangesubnets); + $imported = array_merge($imported, $rangesubnets); } else if (!is_ipaddr($impip) && !is_subnet($impip) && !empty($impip)) { $input_errors[] = sprintf(gettext("%s is not an IP address. Please correct the error to continue"), $impip); } elseif (!empty($impip)) { |