diff options
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/firewall_aliases_edit.php | 1 | ||||
-rwxr-xr-x | usr/local/www/firewall_aliases_import.php | 2 | ||||
-rw-r--r-- | usr/local/www/interfaces_gif_edit.php | 4 | ||||
-rw-r--r-- | usr/local/www/interfaces_gre_edit.php | 4 | ||||
-rw-r--r-- | usr/local/www/interfaces_ppps_edit.php | 24 |
5 files changed, 19 insertions, 16 deletions
diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 2a70a97..746a627 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -259,6 +259,7 @@ if ($_POST) { $wrongaliases = ""; $desc_fmt_err_found = false; $alias_address_count = 0; + $input_addresses = array(); // First trim and expand the input data. // Users can paste strings like "10.1.2.0/24 10.3.0.0/16 9.10.11.0/24" into an address box. diff --git a/usr/local/www/firewall_aliases_import.php b/usr/local/www/firewall_aliases_import.php index fbf31c9..f29c9b5 100755 --- a/usr/local/www/firewall_aliases_import.php +++ b/usr/local/www/firewall_aliases_import.php @@ -67,7 +67,7 @@ if (!is_array($config['aliases']['alias'])) $config['aliases']['alias'] = array(); $a_aliases = &$config['aliases']['alias']; -if($_POST['aliasimport'] <> "") { +if ($_POST) { $reqdfields = explode(" ", "name aliasimport"); $reqdfieldsn = array(gettext("Name"),gettext("Aliases")); diff --git a/usr/local/www/interfaces_gif_edit.php b/usr/local/www/interfaces_gif_edit.php index bb6900a..341f465 100644 --- a/usr/local/www/interfaces_gif_edit.php +++ b/usr/local/www/interfaces_gif_edit.php @@ -78,8 +78,8 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr"); - $reqdfieldsn = array(gettext("Parent interface,Local address, Remote tunnel address, Remote tunnel network, Local tunnel address")); + $reqdfields = explode(" ", "if remote-addr tunnel-local-addr tunnel-remote-addr tunnel-remote-net"); + $reqdfieldsn = array(gettext("Parent interface"), gettext("gif remote address"), gettext("gif tunnel local address"), gettext("gif tunnel remote address"), gettext("gif tunnel remote netmask")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); diff --git a/usr/local/www/interfaces_gre_edit.php b/usr/local/www/interfaces_gre_edit.php index 9d89ca6..cd9f226 100644 --- a/usr/local/www/interfaces_gre_edit.php +++ b/usr/local/www/interfaces_gre_edit.php @@ -77,8 +77,8 @@ if ($_POST) { $pconfig = $_POST; /* input validation */ - $reqdfields = explode(" ", "if tunnel-remote-addr tunnel-remote-net tunnel-local-addr"); - $reqdfieldsn = array(gettext("Parent interface"),gettext("Local address"),gettext("Remote tunnel address"),gettext("Remote tunnel network"), gettext("Local tunnel address")); + $reqdfields = explode(" ", "if remote-addr tunnel-local-addr tunnel-remote-addr tunnel-remote-net"); + $reqdfieldsn = array(gettext("Parent interface"), gettext("Remote tunnel endpoint IP address"), gettext("Local tunnel IP address"), gettext("Remote tunnel IP address"), gettext("Remote tunnel network")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors); diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php index eaef46f..77bc825 100644 --- a/usr/local/www/interfaces_ppps_edit.php +++ b/usr/local/www/interfaces_ppps_edit.php @@ -248,17 +248,19 @@ if ($_POST) { $input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!"); } - foreach($_POST['interfaces'] as $iface){ - if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) - $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface); - if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) - $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface); - if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) - $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface); - if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) - $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface); - if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) - $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface); + if (is_array($_POST['interfaces'])) { + foreach($_POST['interfaces'] as $iface){ + if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) + $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."),$iface); + if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) + $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."),$iface); + if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) + $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."),$iface); + if ($_POST['mtu'][$iface] && ($_POST['mtu'][$iface] < 576)) + $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."),$iface); + if ($_POST['mru'][$iface] && ($_POST['mru'][$iface] < 576)) + $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."),$iface); + } } /* |