-
- 0) {
- foreach ($a_gateways as $gateway) {
- if($gateway['interface'] == $if && $gateway['type'] == 'IPv6') {
- ?>
-
-
-
-
- Select a existing Gateway from the list or add one on the Gateways page
- TODO: use Ajax, similar to IPv4
-
-
-
-
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 650c7970c7..fe466da40a 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -38,7 +38,6 @@
require("guiconfig.inc");
-require_once("IPv6.inc");
$pconfig['hostname'] = $config['system']['hostname'];
$pconfig['domain'] = $config['system']['domain'];
@@ -111,25 +110,12 @@ if ($_POST) {
if ($_POST['domain'] && !is_domain($_POST['domain'])) {
$input_errors[] = "The domain may only contain the characters a-z, 0-9, '-' and '.'.";
}
- /*
if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server.";
}
if (($_POST['dns3'] && !is_ipaddr($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddr($_POST['dns4']))) {
$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS server.";
}
- */
-
- if (
- $_POST['dns1'] && !is_ipaddr($_POST['dns1']) && !Net_IPv6::checkIPv6($_POST['dns1']) ||
- $_POST['dns2'] && !is_ipaddr($_POST['dns2']) && !Net_IPv6::checkIPv6($_POST['dns2']) ||
- $_POST['dns3'] && !is_ipaddr($_POST['dns3']) && !Net_IPv6::checkIPv6($_POST['dns3']) ||
- $_POST['dns4'] && !is_ipaddr($_POST['dns4']) && !Net_IPv6::checkIPv6($_POST['dns4'])
- ) {
- $input_errors[] = "A valid IPv4/IPv6 address must be specified for the primary/secondary DNS server.";
- }
-
-
if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
$input_errors[] = "A valid TCP/IP port must be specified for the webConfigurator port.";
@@ -267,7 +253,7 @@ include("head.inc");
- e.g. example.com
+ e.g. mycorp.com
@@ -321,7 +307,7 @@ include("head.inc");
- IPv4/IPv6 addresses; these are also used for the DHCP
+ IP addresses; these are also used for the DHCP
service, DNS forwarder and for PPTP VPN clients.
diff --git a/usr/local/www/system_gateways_edit.php b/usr/local/www/system_gateways_edit.php
index 314b45dfe1..a8aa571897 100755
--- a/usr/local/www/system_gateways_edit.php
+++ b/usr/local/www/system_gateways_edit.php
@@ -38,17 +38,17 @@
require("guiconfig.inc");
-require_once("IPv6.inc");
$a_gateways = return_gateways_array();
-
-if (isset($_GET['id'])) {
- $id = $_GET['id'];
-} else if (isset($_POST['id'])) {
- $id = $_POST['id'];
-} else {
- $id = -1;
+$a_gateways_arr = array();
+foreach($a_gateways as $gw) {
+ $a_gateways_arr[] = $gw;
}
+$a_gateways = $a_gateways_arr;
+
+$id = $_GET['id'];
+if (isset($_POST['id']))
+ $id = $_POST['id'];
if (isset($_GET['dup'])) {
$id = $_GET['dup'];
@@ -62,7 +62,6 @@ if (isset($id) && $a_gateways[$id]) {
$pconfig['monitor'] = $a_gateways[$id]['monitor'];
$pconfig['descr'] = $a_gateways[$id]['descr'];
$pconfig['attribute'] = $a_gateways[$id]['attribute'];
- $pconfig['type'] = $a_gateways[$id]['type'];
}
if (isset($_GET['dup'])) {
@@ -81,33 +80,15 @@ if ($_POST) {
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
- /* Does this gateway name already exist? */
- foreach($config['gateways']['gateway_item'] as $gw)
- if($gw['name'] == $_POST['name'])
- $input_errors[] = "This gateway name already exists.";
-
if (! isset($_POST['name'])) {
$input_errors[] = "A valid gateway name must be specified.";
}
-
- if ($_POST['type'] == 'IPv4') {
- if (!is_ipaddr($_POST['gateway']) && $pconfig['attribute'] != 'system') {
- $input_errors[] = "A valid IPv4 gateway address must be specified.";
- }
-
- if ($_POST['monitor'] && !is_ipaddr($_POST['monitor'])) {
- $input_errors[] = "A valid IPv4 monitor address must be specified.";
- }
- } else if ($_POST['type'] == 'IPv6') {
- if (!Net_IPv6::checkIPv6($_POST['gateway']) && $pconfig['attribute'] != 'system') {
- $input_errors[] = "A valid IPv6 gateway address must be specified.";
- }
-
- if ($_POST['monitor'] && !Net_IPv6::checkIPv6($_POST['monitor'])) {
- $input_errors[] = "A valid IPv6 monitor address must be specified.";
- }
- } else {
- $input_errors[] = "A network type must be specified.";
+ /* skip system gateways which have been automatically added */
+ if ($_POST['gateway'] && (!is_ipaddr($_POST['gateway'])) && ($pconfig['attribute'] != "system")) {
+ $input_errors[] = "A valid gateway IP address must be specified.";
+ }
+ if ((($_POST['monitor'] <> "") && !is_ipaddr($_POST['monitor']))) {
+ $input_errors[] = "A valid monitor IP address must be specified.";
}
/* check for overlaps */
@@ -148,18 +129,16 @@ if ($_POST) {
$gateway['name'] = $_POST['name'];
$gateway['gateway'] = $_POST['gateway'];
$gateway['descr'] = $_POST['descr'];
- $gateway['type'] = $_POST['type'];
if ($_POST['defaultgw'] == "yes") {
- $i=0;
- foreach ($a_gateways as $gateway) {
- if($id != $i && $config['gateways']['gateway_item'][$i]['type'] == $_POST['type']) {
- unset($config['gateways']['gateway_item'][$i]['defaultgw']);
- } else if ($config['gateways']['gateway_item'][$i]['type'] == $_POST['type']) {
- $config['gateways']['gateway_item'][$i]['defaultgw'] = true;
- }
+ $i = 0;
+ foreach($a_gateways as $gw) {
+ unset($config['gateways'][$i]['defaultgw']);
$i++;
}
+ $gateway['defaultgw'] = true;
+ } else {
+ unset($gateway['defaultgw']);
}
/* when saving the manual gateway we use the attribute which has the corresponding id */
@@ -231,33 +210,11 @@ include("head.inc");
Gateway name
-
Alternative monitor IP
- Enter an alternative address here to be used to monitor the link. This is used for the
+ Enter a alternative address here to be used to monitor the link. This is used for the
quality RRD graphs as well as the load balancer entries. Use this if the gateway does not respond
to icmp requests.