From 8c65eb759d23f9b33762573667718d4a0fd2a71d Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 17 Oct 2005 20:34:29 +0000 Subject: MFC 6931 * Check for "yes". * Unset values if they are not checked --- usr/local/www/services_dhcp.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'usr/local/www/services_dhcp.php') 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) {   - onClick="enable_change(false)"> + onClick="enable_change(false)"> Enable DHCP server on interface @@ -253,7 +263,7 @@ function enable_change(enable_over) {   -> + > Deny unknown clients
If this is checked, only the clients defined below will get DHCP leases from this server. -- cgit v1.1