summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-10-17 20:34:29 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-10-17 20:34:29 +0000
commit8c65eb759d23f9b33762573667718d4a0fd2a71d (patch)
treec3db892e523ad36525b4c39eedd5373a2aa20264
parent201725158915251a29de97f499d372ffe39f6d5f (diff)
downloadpfsense-8c65eb759d23f9b33762573667718d4a0fd2a71d.zip
pfsense-8c65eb759d23f9b33762573667718d4a0fd2a71d.tar.gz
MFC 6931
* Check for "yes". * Unset values if they are not checked
-rwxr-xr-xusr/local/www/services_dhcp.php22
1 files changed, 16 insertions, 6 deletions
diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php
index a582c0f..c9c2ce5 100755
--- a/usr/local/www/services_dhcp.php
+++ b/usr/local/www/services_dhcp.php
@@ -141,8 +141,6 @@ if ($_POST) {
$config['dhcpd'][$if]['range']['to'] = $_POST['range_to'];
$config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime'];
$config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
- $config['dhcpd'][$if]['enable'] = $_POST['enable'] ? true : false;
- $config['dhcpd'][$if]['denyunknown'] = $_POST['denyunknown'] ? true : false;
$config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
unset($config['dhcpd'][$if]['winsserver']);
@@ -160,8 +158,20 @@ if ($_POST) {
$config['dhcpd'][$if]['gateway'] = $_POST['gateway'];
- $config['dhcpd'][$if]['staticarp'] = $_POST['staticarp'] ? true : false;
-
+ if($_POST['denyunknown'] == "yes")
+ $config['dhcpd'][$if]['denyunknown'] = true;
+ else
+ unset($config['dhcpd'][$if]['denyunknown']);
+
+ if($_POST['enable'] == "yes")
+ $config['dhcpd'][$if]['enable'] = $_POST['enable'];
+ else
+ unset($config['dhcpd'][$if]['enable']);
+
+ if($_POST['staticarp'] == "yes")
+ $config['dhcpd'][$if]['staticarp'] = true;
+ else
+ unset($config['dhcpd'][$if]['staticarp']);
write_config();
@@ -245,7 +255,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td>
<td width="78%" class="vtable">
-<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
<strong>Enable DHCP server on
<?=htmlspecialchars($iflist[$if]);?>
interface</strong></td>
@@ -253,7 +263,7 @@ function enable_change(enable_over) {
<tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td>
<td width="78%" class="vtable">
-<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
+ <input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
<strong>Deny unknown clients</strong><br>
If this is checked, only the clients defined below will get DHCP leases from this server. </td>
</tr>
OpenPOWER on IntegriCloud