diff options
-rw-r--r-- | src/usr/local/www/services_ntpd_acls.php | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/usr/local/www/services_ntpd_acls.php b/src/usr/local/www/services_ntpd_acls.php index 11c4cc3..a1a5a93 100644 --- a/src/usr/local/www/services_ntpd_acls.php +++ b/src/usr/local/www/services_ntpd_acls.php @@ -70,7 +70,7 @@ if (!is_array($config['ntpd'])) { if (is_array($config['ntpd']['restrictions']) && is_array($config['ntpd']['restrictions']['row'])) { $networkacl = $config['ntpd']['restrictions']['row']; -} else { +} else { $networkacl = array('0' => array('acl_network' => '', 'mask' => '')); } @@ -121,19 +121,14 @@ if ($_POST) { if (isset($networkacl[$x]['notrap']) || isset($networkacl[$x]['kod']) || isset($networkacl[$x]['nomodify']) || isset($networkacl[$x]['noquery']) || isset($networkacl[$x]['nopeer']) || isset($networkacl[$x]['noserve'])) { if (!is_ipaddr($networkacl[$x]['acl_network'])) { - $input_errors[] = gettext("A valid IP address must be entered for each row under Networks."); + $input_errors[] = sprintf(gettext("A valid IP address must be entered for row %s under Networks."), $networkacl[$x]['acl_network']); } else { - - if (is_ipaddr($networkacl[$x]['acl_network'])) { - if (!is_subnet($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) { - $input_errors[] = gettext("A valid IPv4 netmask must be entered for each IPv4 row under Networks."); - } - } else if (function_exists("is_ipaddrv6")) { - if (!is_ipaddrv6($networkacl[$x]['acl_network'])) { - $input_errors[] = gettext("A valid IPv6 address must be entered for {$networkacl[$x]['acl_network']}."); - } else if (!is_subnetv6($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) { - $input_errors[] = gettext("A valid IPv6 netmask must be entered for each IPv6 row under Networks."); + if (is_ipaddrv4($networkacl[$x]['acl_network'])) { + if (!is_subnetv4($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) { + $input_errors[] = sprintf(gettext("A valid IPv4 netmask must be entered for IPv4 row %s under Networks."), $networkacl[$x]['acl_network']); } + } else if (!is_subnetv6($networkacl[$x]['acl_network']."/".$networkacl[$x]['mask'])) { + $input_errors[] = sprintf(gettext("A valid IPv6 netmask must be entered for IPv6 row %s under Networks."), $networkacl[$x]['acl_network']); } } } |