summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-10-20 12:00:54 -0500
committerRenato Botelho <garga@FreeBSD.org>2014-10-20 12:00:54 -0500
commita23adfbaa079f0f3075343495746e1d613907a25 (patch)
tree9e6dabde73708c35498031deac201cf972587a57 /usr
parent6d9514581abc09a05f6d86633bbd0bb08aab2cf5 (diff)
parent3b5707db5bd1ea4d886b41f86bca7481b0485f16 (diff)
downloadpfsense-a23adfbaa079f0f3075343495746e1d613907a25.zip
pfsense-a23adfbaa079f0f3075343495746e1d613907a25.tar.gz
Merge pull request #1306 from phil-davis/patch-3
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/services_dhcp.php14
-rw-r--r--usr/local/www/services_dhcp_edit.php14
-rw-r--r--usr/local/www/services_dhcpv6.php14
-rw-r--r--usr/local/www/services_router_advertisements.php16
4 files changed, 45 insertions, 13 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index 862518c..22efccf 100644
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -191,7 +191,7 @@ if (is_array($dhcpdconf)) {
$pconfig['domain'] = $dhcpdconf['domain'];
$pconfig['domainsearchlist'] = $dhcpdconf['domainsearchlist'];
list($pconfig['wins1'],$pconfig['wins2']) = $dhcpdconf['winsserver'];
- list($pconfig['dns1'],$pconfig['dns2']) = $dhcpdconf['dnsserver'];
+ list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $dhcpdconf['dnsserver'];
$pconfig['denyunknown'] = isset($dhcpdconf['denyunknown']);
$pconfig['ddnsdomain'] = $dhcpdconf['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $dhcpdconf['ddnsdomainprimary'];
@@ -266,8 +266,8 @@ if (isset($_POST['submit'])) {
if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
}
- if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
- $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
+ if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddrv4($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddrv4($_POST['dns4'])))
+ $input_errors[] = gettext("A valid IP address must be specified for each of the DNS servers.");
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
@@ -488,6 +488,10 @@ if (isset($_POST['submit'])) {
$dhcpdconf['dnsserver'][] = $_POST['dns1'];
if ($_POST['dns2'])
$dhcpdconf['dnsserver'][] = $_POST['dns2'];
+ if ($_POST['dns3'])
+ $dhcpdconf['dnsserver'][] = $_POST['dns3'];
+ if ($_POST['dns4'])
+ $dhcpdconf['dnsserver'][] = $_POST['dns4'];
$dhcpdconf['gateway'] = $_POST['gateway'];
$dhcpdconf['domain'] = $_POST['domain'];
@@ -641,6 +645,8 @@ include("head.inc");
document.iform.wins2.disabled = endis;
document.iform.dns1.disabled = endis;
document.iform.dns2.disabled = endis;
+ document.iform.dns3.disabled = endis;
+ document.iform.dns4.disabled = endis;
document.iform.deftime.disabled = endis;
document.iform.maxtime.disabled = endis;
document.iform.gateway.disabled = endis;
@@ -928,6 +934,8 @@ include("head.inc");
<td width="78%" class="vtable">
<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>" /><br />
<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>" /><br />
+ <input name="dns3" type="text" class="formfld unknown" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>" /><br />
+ <input name="dns4" type="text" class="formfld unknown" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>" /><br />
<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
</td>
</tr>
diff --git a/usr/local/www/services_dhcp_edit.php b/usr/local/www/services_dhcp_edit.php
index bbc52ca..29c2a72 100644
--- a/usr/local/www/services_dhcp_edit.php
+++ b/usr/local/www/services_dhcp_edit.php
@@ -108,7 +108,7 @@ if (isset($id) && $a_maps[$id]) {
$pconfig['domain'] = $a_maps[$id]['domain'];
$pconfig['domainsearchlist'] = $a_maps[$id]['domainsearchlist'];
list($pconfig['wins1'],$pconfig['wins2']) = $a_maps[$id]['winsserver'];
- list($pconfig['dns1'],$pconfig['dns2']) = $a_maps[$id]['dnsserver'];
+ list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $a_maps[$id]['dnsserver'];
$pconfig['ddnsdomain'] = $a_maps[$id]['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $a_maps[$id]['ddnsdomainprimary'];
$pconfig['ddnsdomainkeyname'] = $a_maps[$id]['ddnsdomainkeyname'];
@@ -133,6 +133,8 @@ if (isset($id) && $a_maps[$id]) {
$pconfig['wins2'] = $_GET['wins2'];
$pconfig['dns1'] = $_GET['dns1'];
$pconfig['dns2'] = $_GET['dns2'];
+ $pconfig['dns3'] = $_GET['dns3'];
+ $pconfig['dns4'] = $_GET['dns4'];
$pconfig['ddnsdomain'] = $_GET['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $_GET['ddnsdomainprimary'];
$pconfig['ddnsdomainkeyname'] = $_GET['ddnsdomainkeyname'];
@@ -229,8 +231,8 @@ if ($_POST) {
if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
}
- if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
- $input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
+ if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddrv4($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddrv4($_POST['dns4'])))
+ $input_errors[] = gettext("A valid IP address must be specified for each of the DNS servers.");
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
@@ -284,6 +286,10 @@ if ($_POST) {
$mapent['dnsserver'][] = $_POST['dns1'];
if ($_POST['dns2'])
$mapent['dnsserver'][] = $_POST['dns2'];
+ if ($_POST['dns3'])
+ $mapent['dnsserver'][] = $_POST['dns3'];
+ if ($_POST['dns4'])
+ $mapent['dnsserver'][] = $_POST['dns4'];
$mapent['gateway'] = $_POST['gateway'];
$mapent['domain'] = $_POST['domain'];
@@ -439,6 +445,8 @@ include("head.inc");
<td width="78%" class="vtable">
<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>" /><br />
<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>" /><br />
+ <input name="dns3" type="text" class="formfld unknown" id="dns3" size="20" value="<?=htmlspecialchars($pconfig['dns3']);?>" /><br />
+ <input name="dns4" type="text" class="formfld unknown" id="dns4" size="20" value="<?=htmlspecialchars($pconfig['dns4']);?>" /><br />
<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
</td>
</tr>
diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php
index 7f56a6c..dfe6c25 100644
--- a/usr/local/www/services_dhcpv6.php
+++ b/usr/local/www/services_dhcpv6.php
@@ -106,7 +106,7 @@ if (is_array($config['dhcpdv6'][$if])){
$pconfig['domain'] = $config['dhcpdv6'][$if]['domain'];
$pconfig['domainsearchlist'] = $config['dhcpdv6'][$if]['domainsearchlist'];
list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpdv6'][$if]['winsserver'];
- list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpdv6'][$if]['dnsserver'];
+ list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['dhcpdv6'][$if]['dnsserver'];
$pconfig['enable'] = isset($config['dhcpdv6'][$if]['enable']);
$pconfig['ddnsdomain'] = $config['dhcpdv6'][$if]['ddnsdomain'];
$pconfig['ddnsdomainprimary'] = $config['dhcpdv6'][$if]['ddnsdomainprimary'];
@@ -184,8 +184,8 @@ if ($_POST) {
$input_errors[] = gettext("A valid range must be specified.");
if (($_POST['gateway'] && !is_ipaddrv6($_POST['gateway'])))
$input_errors[] = gettext("A valid IPv6 address must be specified for the gateway.");
- if (($_POST['dns1'] && !is_ipaddrv6($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv6($_POST['dns2'])))
- $input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary DNS servers.");
+ if (($_POST['dns1'] && !is_ipaddrv6($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv6($_POST['dns2'])) || ($_POST['dns3'] && !is_ipaddrv6($_POST['dns3'])) || ($_POST['dns4'] && !is_ipaddrv6($_POST['dns4'])))
+ $input_errors[] = gettext("A valid IPv6 address must be specified for each of the DNS servers.");
if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
@@ -295,6 +295,10 @@ if ($_POST) {
$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns1'];
if ($_POST['dns2'])
$config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns2'];
+ if ($_POST['dns3'])
+ $config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns3'];
+ if ($_POST['dns4'])
+ $config['dhcpdv6'][$if]['dnsserver'][] = $_POST['dns4'];
$config['dhcpdv6'][$if]['domain'] = $_POST['domain'];
$config['dhcpdv6'][$if]['domainsearchlist'] = $_POST['domainsearchlist'];
@@ -404,6 +408,8 @@ include("head.inc");
document.iform.prefixrange_length.disabled = endis;
document.iform.dns1.disabled = endis;
document.iform.dns2.disabled = endis;
+ document.iform.dns3.disabled = endis;
+ document.iform.dns4.disabled = endis;
document.iform.deftime.disabled = endis;
document.iform.maxtime.disabled = endis;
//document.iform.gateway.disabled = endis;
@@ -625,6 +631,8 @@ display_top_tabs($tab_array);
<td width="78%" class="vtable">
<input name="dns1" type="text" class="formfld unknown" id="dns1" size="28" value="<?=htmlspecialchars($pconfig['dns1']);?>" /><br />
<input name="dns2" type="text" class="formfld unknown" id="dns2" size="28" value="<?=htmlspecialchars($pconfig['dns2']);?>" /><br />
+ <input name="dns3" type="text" class="formfld unknown" id="dns3" size="28" value="<?=htmlspecialchars($pconfig['dns3']);?>" /><br />
+ <input name="dns4" type="text" class="formfld unknown" id="dns4" size="28" value="<?=htmlspecialchars($pconfig['dns4']);?>" /><br />
<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
</td>
</tr>
diff --git a/usr/local/www/services_router_advertisements.php b/usr/local/www/services_router_advertisements.php
index 6686052..370fa2f 100644
--- a/usr/local/www/services_router_advertisements.php
+++ b/usr/local/www/services_router_advertisements.php
@@ -96,7 +96,7 @@ if (is_array($config['dhcpdv6'][$if])) {
$pconfig['rapriority'] = "medium";
$pconfig['rainterface'] = $config['dhcpdv6'][$if]['rainterface'];
$pconfig['radomainsearchlist'] = $config['dhcpdv6'][$if]['radomainsearchlist'];
- list($pconfig['radns1'],$pconfig['radns2']) = $config['dhcpdv6'][$if]['radnsserver'];
+ list($pconfig['radns1'],$pconfig['radns2'],$pconfig['radns3'],$pconfig['radns4']) = $config['dhcpdv6'][$if]['radnsserver'];
$pconfig['rasamednsasdhcp6'] = isset($config['dhcpdv6'][$if]['rasamednsasdhcp6']);
$pconfig['subnets'] = $config['dhcpdv6'][$if]['subnets']['item'];
@@ -145,8 +145,8 @@ if ($_POST) {
}
}
- if (($_POST['radns1'] && !is_ipaddrv6($_POST['radns1'])) || ($_POST['radns2'] && !is_ipaddrv6($_POST['radns2'])))
- $input_errors[] = gettext("A valid IPv6 address must be specified for the primary/secondary DNS servers.");
+ if (($_POST['radns1'] && !is_ipaddrv6($_POST['radns1'])) || ($_POST['radns2'] && !is_ipaddrv6($_POST['radns2'])) || ($_POST['radns3'] && !is_ipaddrv6($_POST['radns3'])) || ($_POST['radns4'] && !is_ipaddrv6($_POST['radns4'])))
+ $input_errors[] = gettext("A valid IPv6 address must be specified for each of the DNS servers.");
if ($_POST['radomainsearchlist']) {
$domain_array=preg_split("/[ ;]+/",$_POST['radomainsearchlist']);
foreach ($domain_array as $curdomain) {
@@ -171,6 +171,10 @@ if ($_POST) {
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns1'];
if ($_POST['radns2'])
$config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns2'];
+ if ($_POST['radns3'])
+ $config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns3'];
+ if ($_POST['radns4'])
+ $config['dhcpdv6'][$if]['radnsserver'][] = $_POST['radns4'];
$config['dhcpdv6'][$if]['rasamednsasdhcp6'] = ($_POST['rasamednsasdhcp6']) ? true : false;
@@ -373,6 +377,8 @@ display_top_tabs($tab_array);
<td width="78%" class="vtable">
<input name="radns1" type="text" class="formfld unknown" id="radns1" size="28" value="<?=htmlspecialchars($pconfig['radns1']);?>" /><br />
<input name="radns2" type="text" class="formfld unknown" id="radns2" size="28" value="<?=htmlspecialchars($pconfig['radns2']);?>" /><br />
+ <input name="radns3" type="text" class="formfld unknown" id="radns3" size="28" value="<?=htmlspecialchars($pconfig['radns3']);?>" /><br />
+ <input name="radns4" type="text" class="formfld unknown" id="radns4" size="28" value="<?=htmlspecialchars($pconfig['radns4']);?>" /><br />
<?=gettext("NOTE: leave blank to use the system default DNS servers - this interface's IP if DNS forwarder is enabled, otherwise the servers configured on the General page.");?>
</td>
</tr>
@@ -411,7 +417,7 @@ display_top_tabs($tab_array);
//<![CDATA[
jQuery(function ($) {
var $rasamednsasdhcp6 = $("#rasamednsasdhcp6");
- var $triggered_checkboxes = $("#radns1, #radns2, #radomainsearchlist");
+ var $triggered_checkboxes = $("#radns1, #radns2, #radns3, #radns4, #radomainsearchlist");
if ($rasamednsasdhcp6.length !== 1) { return; }
var onchange = function () {
var checked = $rasamednsasdhcp6.is(":checked");
@@ -433,6 +439,8 @@ display_top_tabs($tab_array);
<?php } ?>
new AutoSuggestControl(document.getElementById('radns1'), new StateSuggestions(addressarray));
new AutoSuggestControl(document.getElementById('radns2'), new StateSuggestions(addressarray));
+ new AutoSuggestControl(document.getElementById('radns3'), new StateSuggestions(addressarray));
+ new AutoSuggestControl(document.getElementById('radns4'), new StateSuggestions(addressarray));
}
setTimeout(createAutoSuggest, 500);
//]]>
OpenPOWER on IntegriCloud