diff options
Diffstat (limited to 'src/usr/local/www')
-rwxr-xr-x | src/usr/local/www/firewall_aliases_edit.php | 12 | ||||
-rwxr-xr-x | src/usr/local/www/firewall_aliases_import.php | 4 | ||||
-rw-r--r-- | src/usr/local/www/firewall_schedule_edit.php | 9 | ||||
-rw-r--r-- | src/usr/local/www/system_gateway_groups_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/system_gateways_edit.php | 2 |
5 files changed, 9 insertions, 20 deletions
diff --git a/src/usr/local/www/firewall_aliases_edit.php b/src/usr/local/www/firewall_aliases_edit.php index 5d2ac60..f96ae3e 100755 --- a/src/usr/local/www/firewall_aliases_edit.php +++ b/src/usr/local/www/firewall_aliases_edit.php @@ -175,16 +175,10 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - $x = is_validaliasname($_POST['name']); - if (!isset($x)) { - $input_errors[] = gettext("Reserved word used for alias name."); - } else if ($_POST['type'] == "port" && (getservbyname($_POST['name'], "tcp") || getservbyname($_POST['name'], "udp"))) { - $input_errors[] = gettext("Reserved word used for alias name."); - } else { - if (is_validaliasname($_POST['name']) == false) { - $input_errors[] = sprintf(gettext("The alias name must be less than 32 characters long, may not consist of only numbers, may not consist of only underscores, and may only contain the following characters: %s"), 'a-z, A-Z, 0-9, _'); - } + if (!is_validaliasname($_POST['name'])) { + $input_errors[] = invalidaliasnamemsg($_POST['name']); } + /* check for name conflicts */ foreach ($a_aliases as $key => $alias) { if (($alias['name'] == $_POST['name']) && (empty($a_aliases[$id]) || ($key != $id))) { diff --git a/src/usr/local/www/firewall_aliases_import.php b/src/usr/local/www/firewall_aliases_import.php index 77b2adf..04c1617 100755 --- a/src/usr/local/www/firewall_aliases_import.php +++ b/src/usr/local/www/firewall_aliases_import.php @@ -94,8 +94,8 @@ if ($_POST['aliasimport'] != "") { do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); - if (is_validaliasname($_POST['name']) == false) { - $input_errors[] = sprintf(gettext("The alias name may only consist of the characters %s"), "a-z, A-Z, 0-9, _."); + if (!is_validaliasname($_POST['name'])) { + $input_errors[] = invalidaliasnamemsg($_POST['name']); } /* check for name duplicates */ diff --git a/src/usr/local/www/firewall_schedule_edit.php b/src/usr/local/www/firewall_schedule_edit.php index 5ef540e..26470d8 100644 --- a/src/usr/local/www/firewall_schedule_edit.php +++ b/src/usr/local/www/firewall_schedule_edit.php @@ -125,13 +125,8 @@ if ($_POST) { $input_errors[] = gettext("Schedule name cannot be blank."); } - $x = is_validaliasname($_POST['name']); - if (!isset($x)) { - $input_errors[] = gettext("Reserved word used for schedule name."); - } else { - if (is_validaliasname($_POST['name']) == false) { - $input_errors[] = sprintf(gettext("The schedule name must be less than 32 characters long, may not consist of only numbers, may not consist of only underscores, and may only contain the following characters: %s"), 'a-z, A-Z, 0-9, _'); - } + if (!is_validaliasname($_POST['name'])) { + $input_errors[] = invalidaliasnamemsg($_POST['name'], gettext("schedule")); } /* check for name conflicts */ diff --git a/src/usr/local/www/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php index d130a69..f1a3045 100644 --- a/src/usr/local/www/system_gateway_groups_edit.php +++ b/src/usr/local/www/system_gateway_groups_edit.php @@ -115,7 +115,7 @@ if ($_POST) { $input_errors[] = gettext("A valid gateway group name must be specified."); } if (!is_validaliasname($_POST['name'])) { - $input_errors[] = gettext("The gateway name must not contain invalid characters."); + $input_errors[] = invalidaliasnamemsg($_POST['name'], gettext("gateway group")); } if (isset($_POST['name'])) { diff --git a/src/usr/local/www/system_gateways_edit.php b/src/usr/local/www/system_gateways_edit.php index f483979..cbbea08 100644 --- a/src/usr/local/www/system_gateways_edit.php +++ b/src/usr/local/www/system_gateways_edit.php @@ -147,7 +147,7 @@ if ($_POST) { $input_errors[] = "A valid gateway name must be specified."; } if (!is_validaliasname($_POST['name'])) { - $input_errors[] = gettext("The gateway name must not contain invalid characters."); + $input_errors[] = invalidaliasnamemsg($_POST['name'], gettext("gateway")); } else if (isset($_POST['disabled'])) { // We have a valid gateway name that the user wants to mark as disabled. // Check if the gateway name is used in any gateway group. |