diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-10-16 16:44:06 -0500 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-10-16 16:44:06 -0500 |
commit | 308e304218e31173abc94948d5c0ef33bc6c5454 (patch) | |
tree | 186d783c6a3e52ad6da5d7ac795ba1e0a5d6e317 | |
parent | 497563bec4445add15543a1694ea34ba0149acf6 (diff) | |
parent | 466aae837b9d6ac9dc7d06130841e84195d36e1a (diff) | |
download | pfsense-308e304218e31173abc94948d5c0ef33bc6c5454.zip pfsense-308e304218e31173abc94948d5c0ef33bc6c5454.tar.gz |
Merge pull request #1311 from phil-davis/patch-7
-rw-r--r-- | usr/local/www/services_dhcp.php | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 6de13c2..862518c 100644 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -161,7 +161,17 @@ if (is_array($dhcpdconf)) { // No reason to specify this per-pool, per the dhcpd.conf man page it needs to be in every // pool and should be specified in every pool both nodes share, so we'll treat it as global $pconfig['failover_peerip'] = $dhcpdconf['failover_peerip']; - $pconfig['dhcpleaseinlocaltime'] = $dhcpdconf['dhcpleaseinlocaltime']; + + // dhcpleaseinlocaltime is global to all interfaces. So if it is selected on any interface, + // then show it true/checked. + foreach ($config['dhcpd'] as $dhcpdifitem) { + $dhcpleaseinlocaltime = $dhcpdifitem['dhcpleaseinlocaltime']; + if ($dhcpleaseinlocaltime) + break; + } + + $pconfig['dhcpleaseinlocaltime'] = $dhcpleaseinlocaltime; + if (!is_array($dhcpdconf['staticmap'])) $dhcpdconf['staticmap'] = array(); $a_maps = &$dhcpdconf['staticmap']; @@ -232,7 +242,7 @@ if (isset($_POST['submit'])) { $numberoptions['item'][] = $numbervalue; } } - // Reload the new pconfig variable that the forum uses. + // Reload the new pconfig variable that the form uses. $pconfig['numberoptions'] = $numberoptions; /* input validation */ @@ -451,7 +461,10 @@ if (isset($_POST['submit'])) { if($previous <> $_POST['failover_peerip']) mwexec("/bin/rm -rf /var/dhcpd/var/db/*"); $dhcpdconf['failover_peerip'] = $_POST['failover_peerip']; - $dhcpdconf['dhcpleaseinlocaltime'] = $_POST['dhcpleaseinlocaltime']; + // dhcpleaseinlocaltime is global to all interfaces. So update the setting on all interfaces. + foreach ($config['dhcpd'] as &$dhcpdifitem) { + $dhcpdifitem['dhcpleaseinlocaltime'] = $_POST['dhcpleaseinlocaltime']; + } } else { // Options that exist only in pools $dhcpdconf['descr'] = $_POST['descr']; |