From f9261419cd211f50b3e89bd3cfe1e219a2ce0cdb Mon Sep 17 00:00:00 2001 From: Bill Marquette Date: Tue, 15 Mar 2005 02:37:25 +0000 Subject: Let users change the gateway that dhcpd assigns Hoba, this commit is for you --- usr/local/www/services_dhcp.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 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 9a8614c..c061c0c 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -29,7 +29,7 @@ POSSIBILITY OF SUCH DAMAGE. */ -require("guiconfig.inc"); +require_once("guiconfig.inc"); $if = $_GET['if']; if ($_POST['if']) @@ -52,6 +52,7 @@ $pconfig['range_from'] = $config['dhcpd'][$if]['range']['from']; $pconfig['range_to'] = $config['dhcpd'][$if]['range']['to']; $pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime']; $pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime']; +$pconfig['gateway'] = $config['dhcpd'][$if]['gateway']; list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver']; $pconfig['enable'] = isset($config['dhcpd'][$if]['enable']); $pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']); @@ -82,6 +83,8 @@ if ($_POST) { if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) { $input_errors[] = "A valid range must be specified."; } + if (($_POST['gateway'] && !is_ipaddr($_POST['gateway']))) + $input_errors[] = "A valid IP address must be specified for the gateway."; if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) { $input_errors[] = "A valid IP address must be specified for the primary/secondary WINS server."; } @@ -125,6 +128,8 @@ if ($_POST) { if ($_POST['wins2']) $config['dhcpd'][$if]['winsserver'][] = $_POST['wins2']; + $config['dhcpd'][$if]['gateway'] = $_POST['gateway']; + write_config(); $retval = 0; @@ -170,13 +175,14 @@ function enable_change(enable_over) { document.iform.wins2.disabled = endis; document.iform.deftime.disabled = endis; document.iform.maxtime.disabled = endis; + document.iform.gateway.disabled = endis; } //--> - +

Services: DHCP server

@@ -250,6 +256,11 @@ function enable_change(enable_over) { + Gateway + +
+ + Default lease time @@ -326,6 +337,6 @@ function enable_change(enable_over) { enable_change(false); //--> - + -- cgit v1.1