Project

General

Profile

Download (22.4 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_dhcp_edit.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6

    
7
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9

    
10
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12

    
13
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15

    
16
	2. Redistributions in binary form must reproduce the above copyright
17
	   notice, this list of conditions and the following disclaimer in the
18
	   documentation and/or other materials provided with the distribution.
19

    
20
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
21
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
22
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
23
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
24
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
	POSSIBILITY OF SUCH DAMAGE.
30
*/
31
/*
32
	pfSense_BUILDER_BINARIES:	/usr/sbin/arp
33
	pfSense_MODULE:	dhcpserver
34
*/
35

    
36
##|+PRIV
37
##|*IDENT=page-services-dhcpserver-editstaticmapping
38
##|*NAME=Services: DHCP Server : Edit static mapping page
39
##|*DESCR=Allow access to the 'Services: DHCP Server : Edit static mapping' page.
40
##|*MATCH=services_dhcp_edit.php*
41
##|-PRIV
42

    
43
function staticmapcmp($a, $b) {
44
	return ipcmp($a['ipaddr'], $b['ipaddr']);
45
}
46

    
47
function staticmaps_sort($ifgui) {
48
	global $g, $config;
49

    
50
	usort($config['dhcpd'][$ifgui]['staticmap'], "staticmapcmp");
51
}
52

    
53
require_once('globals.inc');
54

    
55
if(!$g['services_dhcp_server_enable']) {
56
	Header("Location: /");
57
	exit;
58
}
59

    
60
require("guiconfig.inc");
61

    
62
$if = $_GET['if'];
63
if ($_POST['if'])
64
	$if = $_POST['if'];
65

    
66
if (!$if) {
67
	header("Location: services_dhcp.php");
68
	exit;
69
}
70

    
71
if (!is_array($config['dhcpd']))
72
	$config['dhcpd'] = array();
73
if (!is_array($config['dhcpd'][$if]))
74
	$config['dhcpd'][$if] = array();
75
if (!is_array($config['dhcpd'][$if]['staticmap']))
76
	$config['dhcpd'][$if]['staticmap'] = array();
77

    
78
if (!is_array($config['dhcpd'][$if]['pool']))
79
	$config['dhcpd'][$if]['pool'] = array();
80
$a_pools = &$config['dhcpd'][$if]['pool'];
81

    
82
$static_arp_enabled=isset($config['dhcpd'][$if]['staticarp']);
83
$netboot_enabled=isset($config['dhcpd'][$if]['netboot']);
84
$a_maps = &$config['dhcpd'][$if]['staticmap'];
85
$ifcfgip = get_interface_ip($if);
86
$ifcfgsn = get_interface_subnet($if);
87
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
88

    
89
$id = $_GET['id'];
90
if (isset($_POST['id']))
91
	$id = $_POST['id'];
92

    
93
if (isset($id) && $a_maps[$id]) {
94
	$pconfig['mac'] = $a_maps[$id]['mac'];
95
	$pconfig['hostname'] = $a_maps[$id]['hostname'];
96
	$pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
97
	$pconfig['filename'] = $a_maps[$id]['filename'];
98
	$pconfig['rootpath'] = $a_maps[$id]['rootpath'];
99
	$pconfig['descr'] = $a_maps[$id]['descr'];
100
	$pconfig['arp_table_static_entry'] = isset($a_maps[$id]['arp_table_static_entry']);
101
	$pconfig['deftime'] = $a_maps[$id]['defaultleasetime'];
102
	$pconfig['maxtime'] = $a_maps[$id]['maxleasetime'];
103
	$pconfig['gateway'] = $a_maps[$id]['gateway'];
104
	$pconfig['domain'] = $a_maps[$id]['domain'];
105
	$pconfig['domainsearchlist'] = $a_maps[$id]['domainsearchlist'];
106
	list($pconfig['wins1'],$pconfig['wins2']) = $a_maps[$id]['winsserver'];
107
	list($pconfig['dns1'],$pconfig['dns2']) = $a_maps[$id]['dnsserver'];
108
	$pconfig['ddnsdomain'] = $a_maps[$id]['ddnsdomain'];
109
	$pconfig['ddnsupdate'] = isset($a_maps[$id]['ddnsupdate']);
110
	list($pconfig['ntp1'],$pconfig['ntp2']) = $a_maps[$id]['ntpserver'];
111
	$pconfig['tftp'] = $a_maps[$id]['tftp'];
112
} else {
113
	$pconfig['mac'] = $_GET['mac'];
114
	$pconfig['hostname'] = $_GET['hostname'];
115
	$pconfig['filename'] = $_GET['filename'];
116
	$pconfig['rootpath'] = $_GET['rootpath'];
117
	$pconfig['descr'] = $_GET['descr'];
118
	$pconfig['arp_table_static_entry'] = $_GET['arp_table_static_entry'];
119
	$pconfig['deftime'] = $_GET['defaultleasetime'];
120
	$pconfig['maxtime'] = $_GET['maxleasetime'];
121
	$pconfig['gateway'] = $_GET['gateway'];
122
	$pconfig['domain'] = $_GET['domain'];
123
	$pconfig['domainsearchlist'] = $_GET['domainsearchlist'];
124
	$pconfig['wins1'] = $_GET['wins1'];
125
	$pconfig['wins2'] = $_GET['wins2'];
126
	$pconfig['dns1'] = $_GET['dns1'];
127
	$pconfig['dns2'] = $_GET['dns2'];
128
	$pconfig['ddnsdomain'] = $_GET['ddnsdomain'];
129
	$pconfig['ddnsupdate'] = isset($_GET['ddnsupdate']);
130
	$pconfig['ntp1'] = $_GET['ntp1'];
131
	$pconfig['ntp2'] = $_GET['ntp2'];
132
	$pconfig['tftp'] = $_GET['tftp'];
133
}
134

    
135
if ($_POST) {
136

    
137
	unset($input_errors);
138
	$pconfig = $_POST;
139

    
140
	/* input validation */
141
	$reqdfields = explode(" ", "mac");
142
	$reqdfieldsn = array(gettext("MAC address"));
143

    
144
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
145

    
146
	/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
147
	$_POST['mac'] = strtolower(str_replace("-", ":", $_POST['mac']));
148

    
149
	if ($_POST['hostname']) {
150
		preg_match("/\-\$/", $_POST['hostname'], $matches);
151
		if($matches)
152
			$input_errors[] = gettext("The hostname cannot end with a hyphen according to RFC952");
153
		if (!is_hostname($_POST['hostname'])) {
154
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
155
		} else {
156
			if (strpos($_POST['hostname'],'.')) {
157
				$input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
158
			}
159
		}
160
	}
161
	if (($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr']))) {
162
		$input_errors[] = gettext("A valid IP address must be specified.");
163
	}
164
	if (($_POST['mac'] && !is_macaddr($_POST['mac']))) {
165
		$input_errors[] = gettext("A valid MAC address must be specified.");
166
	}
167
	if($static_arp_enabled && !$_POST['ipaddr']) {
168
		$input_errors[] = gettext("Static ARP is enabled.  You must specify an IP address.");
169
	}
170

    
171
	/* check for overlaps */
172
	foreach ($a_maps as $mapent) {
173
		if (isset($id) && ($a_maps[$id]) && ($a_maps[$id] === $mapent))
174
			continue;
175

    
176
		if ((($mapent['hostname'] == $_POST['hostname']) && $mapent['hostname'])  || (($mapent['mac'] == $_POST['mac']) && $mapent['mac']) || (($mapent['ipaddr'] == $_POST['ipaddr']) && $mapent['ipaddr'])) {
177
			$input_errors[] = gettext("This Hostname, IP or MAC address already exists.");
178
			break;
179
		}
180
	}
181

    
182
	/* make sure it's not within the dynamic subnet */
183
	if ($_POST['ipaddr']) {
184
		$dynsubnet_start = ip2ulong($config['dhcpd'][$if]['range']['from']);
185
		$dynsubnet_end = ip2ulong($config['dhcpd'][$if]['range']['to']);
186
		if ((ip2ulong($_POST['ipaddr']) >= $dynsubnet_start) &&
187
			(ip2ulong($_POST['ipaddr']) <= $dynsubnet_end)) {
188
			$input_errors[] = sprintf(gettext("The IP address must not be within the DHCP range for this interface."));
189
		}
190

    
191
		foreach ($a_pools as $pidx => $p) {
192
			if (is_inrange_v4($_POST['ipaddr'], $p['range']['from'], $p['range']['to'])) {
193
				$input_errors[] = gettext("The IP address must not be within the range configured on a DHCP pool for this interface.");
194
				break;
195
			}
196
		}
197

    
198
		$lansubnet_start = ip2ulong(long2ip32(ip2long($ifcfgip) & gen_subnet_mask_long($ifcfgsn)));
199
		$lansubnet_end = ip2ulong(long2ip32(ip2long($ifcfgip) | (~gen_subnet_mask_long($ifcfgsn))));
200
		if ((ip2ulong($_POST['ipaddr']) < $lansubnet_start) ||
201
			(ip2ulong($_POST['ipaddr']) > $lansubnet_end)) {
202
			$input_errors[] = sprintf(gettext("The IP address must lie in the %s subnet."),$ifcfgdescr);
203
		}
204
	}
205

    
206
	if (($_POST['gateway'] && !is_ipaddrv4($_POST['gateway'])))
207
		$input_errors[] = gettext("A valid IP address must be specified for the gateway.");
208
	if (($_POST['wins1'] && !is_ipaddrv4($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddrv4($_POST['wins2'])))
209
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary WINS servers.");
210

    
211
	$parent_ip = get_interface_ip($POST['if']);
212
	if (is_ipaddrv4($parent_ip) && $_POST['gateway']) {
213
		$parent_sn = get_interface_subnet($_POST['if']);
214
		if(!ip_in_subnet($_POST['gateway'], gen_subnet($parent_ip, $parent_sn) . "/" . $parent_sn) && !ip_in_interface_alias_subnet($_POST['if'], $_POST['gateway']))
215
			$input_errors[] = sprintf(gettext("The gateway address %s does not lie within the chosen interface's subnet."), $_POST['gateway']);
216
	}
217
	if (($_POST['dns1'] && !is_ipaddrv4($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddrv4($_POST['dns2'])))
218
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary DNS servers.");
219

    
220
	if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60)))
221
		$input_errors[] = gettext("The default lease time must be at least 60 seconds.");
222
	if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime'])))
223
		$input_errors[] = gettext("The maximum lease time must be at least 60 seconds and higher than the default lease time.");
224
	if (($_POST['ddnsdomain'] && !is_domain($_POST['ddnsdomain'])))
225
		$input_errors[] = gettext("A valid domain name must be specified for the dynamic DNS registration.");
226
	if ($_POST['domainsearchlist']) {
227
		$domain_array=preg_split("/[ ;]+/",$_POST['domainsearchlist']);
228
		foreach ($domain_array as $curdomain) {
229
			if (!is_domain($curdomain)) {
230
				$input_errors[] = gettext("A valid domain search list must be specified.");
231
				break;
232
			}
233
		}
234
	}
235

    
236
	if (($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1'])) || ($_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])))
237
		$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
238
	if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !is_URL($_POST['tftp']))
239
		$input_errors[] = gettext("A valid IP address or hostname must be specified for the TFTP server.");
240
	if (($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])))
241
		$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
242

    
243
	if (!$input_errors) {
244
		$mapent = array();
245
		$mapent['mac'] = $_POST['mac'];
246
		$mapent['ipaddr'] = $_POST['ipaddr'];
247
		$mapent['hostname'] = $_POST['hostname'];
248
		$mapent['descr'] = $_POST['descr'];
249
		$mapent['arp_table_static_entry'] = ($_POST['arp_table_static_entry']) ? true : false;
250
		$mapent['filename'] = $_POST['filename'];
251
		$mapent['rootpath'] = $_POST['rootpath'];
252
		$mapent['defaultleasetime'] = $_POST['deftime'];
253
		$mapent['maxleasetime'] = $_POST['maxtime'];
254

    
255
		unset($mapent['winsserver']);
256
		if ($_POST['wins1'])
257
			$mapent['winsserver'][] = $_POST['wins1'];
258
		if ($_POST['wins2'])
259
			$mapent['winsserver'][] = $_POST['wins2'];
260

    
261
		unset($mapent['dnsserver']);
262
		if ($_POST['dns1'])
263
			$mapent['dnsserver'][] = $_POST['dns1'];
264
		if ($_POST['dns2'])
265
			$mapent['dnsserver'][] = $_POST['dns2'];
266

    
267
		$mapent['gateway'] = $_POST['gateway'];
268
		$mapent['domain'] = $_POST['domain'];
269
		$mapent['domainsearchlist'] = $_POST['domainsearchlist'];
270
		$mapent['ddnsdomain'] = $_POST['ddnsdomain'];
271
		$mapent['ddnsupdate'] = ($_POST['ddnsupdate']) ? true : false;
272

    
273
		unset($mapent['ntpserver']);
274
		if ($_POST['ntp1'])
275
			$mapent['ntpserver'][] = $_POST['ntp1'];
276
		if ($_POST['ntp2'])
277
			$mapent['ntpserver'][] = $_POST['ntp2'];
278

    
279
		$mapent['tftp'] = $_POST['tftp'];
280
		$mapent['ldap'] = $_POST['ldap'];
281

    
282
		if (isset($id) && $a_maps[$id])
283
			$a_maps[$id] = $mapent;
284
		else
285
			$a_maps[] = $mapent;
286
		staticmaps_sort($if);
287

    
288
		write_config();
289

    
290
		if(isset($config['dhcpd'][$if]['enable'])) {
291
			mark_subsystem_dirty('staticmaps');
292
			if (isset($config['dnsmasq']['enable']) && isset($config['dnsmasq']['regdhcpstatic']))
293
				mark_subsystem_dirty('hosts');
294
		}
295

    
296
		header("Location: services_dhcp.php?if={$if}");
297
		exit;
298
	}
299
}
300

    
301
$pgtitle = array(gettext("Services"),gettext("DHCP"),gettext("Edit static mapping"));
302
$shortcut_section = "dhcp";
303

    
304
include("head.inc");
305

    
306
?>
307

    
308
<script type="text/javascript" language="JavaScript">
309
	function show_ddns_config() {
310
		document.getElementById("showddnsbox").innerHTML='';
311
		aodiv = document.getElementById('showddns');
312
		aodiv.style.display = "block";
313
	}
314

    
315
	function show_ntp_config() {
316
		document.getElementById("showntpbox").innerHTML='';
317
		aodiv = document.getElementById('showntp');
318
		aodiv.style.display = "block";
319
	}
320

    
321
	function show_tftp_config() {
322
		document.getElementById("showtftpbox").innerHTML='';
323
		aodiv = document.getElementById('showtftp');
324
		aodiv.style.display = "block";
325
	}
326
</script>
327

    
328
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
329
<?php include("fbegin.inc"); ?>
330
<?php if ($input_errors) print_input_errors($input_errors); ?>
331
            <form action="services_dhcp_edit.php" method="post" name="iform" id="iform">
332
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
333
				<tr>
334
					<td colspan="2" valign="top" class="listtopic"><?=gettext("Static DHCP Mapping");?></td>
335
				</tr>
336
                <tr>
337
                  <td width="22%" valign="top" class="vncellreq"><?=gettext("MAC address");?></td>
338
                  <td width="78%" class="vtable">
339
                    <input name="mac" type="text" class="formfld unknown" id="mac" size="30" value="<?=htmlspecialchars($pconfig['mac']);?>">
340
		    <?php
341
			$ip = getenv('REMOTE_ADDR');
342
			$mac = `/usr/sbin/arp -an | grep {$ip} | cut -d" " -f4`;
343
			$mac = str_replace("\n","",$mac);
344
		    ?>
345
		    <a OnClick="document.forms[0].mac.value='<?=$mac?>';" href="#"><?=gettext("Copy my MAC address");?></a>
346
                    <br>
347
                    <span class="vexpl"><?=gettext("Enter a MAC address in the following format: ".
348
                    "xx:xx:xx:xx:xx:xx");?></span></td>
349
                </tr>
350
                <tr>
351
                  <td width="22%" valign="top" class="vncell"><?=gettext("IP address");?></td>
352
                  <td width="78%" class="vtable">
353
                    <input name="ipaddr" type="text" class="formfld unknown" id="ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipaddr']);?>">
354
                    <br>
355
			<?=gettext("If an IPv4 address is entered, the address must be outside of the pool.");?>
356
			<br/>
357
			<?=gettext("If no IPv4 address is given, one will be dynamically allocated from the pool.");?>
358
			</td>
359
                </tr>
360
                <tr>
361
                  <td width="22%" valign="top" class="vncell"><?=gettext("Hostname");?></td>
362
                  <td width="78%" class="vtable">
363
                    <input name="hostname" type="text" class="formfld unknown" id="hostname" size="20" value="<?=htmlspecialchars($pconfig['hostname']);?>">
364
                    <br> <span class="vexpl"><?=gettext("Name of the host, without domain part.");?></span></td>
365
                </tr>
366
                <?php if($netboot_enabled) { ?>
367
		<tr>
368
		  <td width="22%" valign="top" class="vncell">Netboot Filename</td>
369
		  <td width="78%" class="vtable">
370
		    <input name="filename" type="text" class="formfld unknown" id="filename" size="20" value="<?=htmlspecialchars($pconfig['filename']);?>">
371
		    <br> <span class="vexpl">Name of the file that should be loaded when this host boots off of the network, overrides setting on main page.</span></td>
372
		</tr>
373
		<tr>
374
		  <td width="22%" valign="top" class="vncell">Root Path</td>
375
		  <td width="78%" class="vtable">
376
			<input name="rootpath" type="text" class="formfld unknown" id="rootpath" size="90" value="<?=htmlspecialchars($pconfig['rootpath']);?>">
377
		    <br> <span class="vexpl"><?=gettext("Enter the"); ?> <b><?=gettext("root-path"); ?></b>-<?=gettext("string");?>, overrides setting on main page.</span></td>
378
		</tr>
379
		<?php } ?>
380
                <tr>
381
                  <td width="22%" valign="top" class="vncell"><?=gettext("Description");?></td>
382
                  <td width="78%" class="vtable">
383
                    <input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
384
                    <br> <span class="vexpl"><?=gettext("You may enter a description here ".
385
                    "for your reference (not parsed).");?></span></td>
386
                </tr>
387
                <tr>
388
                  <td width="22%" valign="top" class="vncell"><?=gettext("ARP Table Static Entry");?></td>
389
                  <td width="78%" class="vtable">
390
                    <input name="arp_table_static_entry" id="arp_table_static_entry" type="checkbox" value="yes" <?php if ($pconfig['arp_table_static_entry']) echo "checked"; ?>>
391
                    <br> <span class="vexpl"><?=gettext("Create an ARP Table Static Entry for this MAC & IP Address pair. ".
392
                    "");?></span></td>
393
                </tr>
394
		<tr>
395
		<td width="22%" valign="top" class="vncell"><?=gettext("WINS servers");?></td>
396
		<td width="78%" class="vtable">
397
			<input name="wins1" type="text" class="formfld unknown" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
398
			<input name="wins2" type="text" class="formfld unknown" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
399
		</td>
400
		</tr>
401
		<tr>
402
		<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers");?></td>
403
		<td width="78%" class="vtable">
404
			<input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
405
			<input name="dns2" type="text" class="formfld unknown" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
406
			<?=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.");?>
407
		</td>
408
		</tr>
409
		<tr>
410
		<td width="22%" valign="top" class="vncell"><?=gettext("Gateway");?></td>
411
		<td width="78%" class="vtable">
412
			<input name="gateway" type="text" class="formfld host" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
413
			 <?=gettext("The default is to use the IP on this interface of the firewall as the gateway. Specify an alternate gateway here if this is not the correct gateway for your network.");?>
414
		</td>
415
		</tr>
416
		<tr>
417
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain name");?></td>
418
		<td width="78%" class="vtable">
419
			<input name="domain" type="text" class="formfld unknown" id="domain" size="20" value="<?=htmlspecialchars($pconfig['domain']);?>"><br>
420
			 <?=gettext("The default is to use the domain name of this system as the default domain name provided by DHCP. You may specify an alternate domain name here.");?>
421
		</td>
422
		</tr>
423
		<tr>
424
		<td width="22%" valign="top" class="vncell"><?=gettext("Domain search list");?></td>
425
		<td width="78%" class="vtable">
426
			<input name="domainsearchlist" type="text" class="formfld unknown" id="domainsearchlist" size="20" value="<?=htmlspecialchars($pconfig['domainsearchlist']);?>"><br>
427
			<?=gettext("The DHCP server can optionally provide a domain search list. Use the semicolon character as separator ");?>
428
		</td>
429
		</tr>
430
		<tr>
431
		<td width="22%" valign="top" class="vncell"><?=gettext("Default lease time");?></td>
432
		<td width="78%" class="vtable">
433
			<input name="deftime" type="text" class="formfld unknown" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
434
			<?=gettext("seconds");?><br>
435
			<?=gettext("This is used for clients that do not ask for a specific " .
436
			"expiration time."); ?><br>
437
			<?=gettext("The default is 7200 seconds.");?>
438
		</td>
439
		</tr>
440
		<tr>
441
		<td width="22%" valign="top" class="vncell"><?=gettext("Maximum lease time");?></td>
442
		<td width="78%" class="vtable">
443
			<input name="maxtime" type="text" class="formfld unknown" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
444
			<?=gettext("seconds");?><br>
445
			<?=gettext("This is the maximum lease time for clients that ask".
446
			" for a specific expiration time."); ?><br>
447
			<?=gettext("The default is 86400 seconds.");?>
448
		</td>
449
		</tr>
450
		<tr>
451
		<td width="22%" valign="top" class="vncell"><?=gettext("Dynamic DNS");?></td>
452
		<td width="78%" class="vtable">
453
			<div id="showddnsbox">
454
				<input type="button" onClick="show_ddns_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show Dynamic DNS");?></a>
455
			</div>
456
			<div id="showddns" style="display:none">
457
				<input valign="middle" type="checkbox" value="yes" name="ddnsupdate" id="ddnsupdate" <?php if($pconfig['ddnsupdate']) echo " checked"; ?>>&nbsp;
458
				<b><?=gettext("Enable registration of DHCP client names in DNS.");?></b><br />
459
				<p>
460
				<input name="ddnsdomain" type="text" class="formfld unknown" id="ddnsdomain" size="20" value="<?=htmlspecialchars($pconfig['ddnsdomain']);?>"><br />
461
				<?=gettext("Note: Leave blank to disable dynamic DNS registration.");?><br />
462
				<?=gettext("Enter the dynamic DNS domain which will be used to register client names in the DNS server.");?>
463
			</div>
464
		</td>
465
		</tr>
466
		<tr>
467
		<td width="22%" valign="top" class="vncell"><?=gettext("NTP servers");?></td>
468
		<td width="78%" class="vtable">
469
			<div id="showntpbox">
470
				<input type="button" onClick="show_ntp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show NTP configuration");?></a>
471
			</div>
472
			<div id="showntp" style="display:none">
473
				<input name="ntp1" type="text" class="formfld unknown" id="ntp1" size="20" value="<?=htmlspecialchars($pconfig['ntp1']);?>"><br>
474
				<input name="ntp2" type="text" class="formfld unknown" id="ntp2" size="20" value="<?=htmlspecialchars($pconfig['ntp2']);?>">
475
			</div>
476
		</td>
477
		</tr>
478
		<tr>
479
		<td width="22%" valign="top" class="vncell"><?=gettext("TFTP server");?></td>
480
		<td width="78%" class="vtable">
481
		<div id="showtftpbox">
482
			<input type="button" onClick="show_tftp_config()" value="<?=gettext("Advanced");?>"></input> - <?=gettext("Show TFTP configuration");?></a>
483
		</div>
484
		<div id="showtftp" style="display:none">
485
			<input name="tftp" type="text" class="formfld unknown" id="tftp" size="50" value="<?=htmlspecialchars($pconfig['tftp']);?>"><br>
486
			<?=gettext("Leave blank to disable.  Enter a full hostname or IP for the TFTP server.");?>
487
		</div>
488
		</td>
489
		</tr>
490
		<tr>
491
                <tr>
492
                  <td width="22%" valign="top">&nbsp;</td>
493
                  <td width="78%">
494
                    <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>"> <input class="formbtn" type="button" value="<?=gettext("Cancel");?>" onclick="history.back()">
495
                    <?php if (isset($id) && $a_maps[$id]): ?>
496
                    <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>">
497
                    <?php endif; ?>
498
                    <input name="if" type="hidden" value="<?=htmlspecialchars($if);?>">
499
                  </td>
500
                </tr>
501
              </table>
502
</form>
503
<?php include("fend.inc"); ?>
504
</body>
505
</html>
(149-149/246)