Projet

Général

Profil

Télécharger (22,5 ko) Statistiques
| Branche: | Tag: | Révision:

univnautes / usr / local / www / services_dhcp_edit.php @ 2d1e985d

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
if (is_numericint($_GET['id']))
90
	$id = $_GET['id'];
91
if (isset($_POST['id']) && is_numericint($_POST['id']))
92
	$id = $_POST['id'];
93

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

    
136
if ($_POST) {
137

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
289
		write_config();
290

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

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

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

    
305
include("head.inc");
306

    
307
?>
308

    
309
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
310

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

    
318
	function show_ntp_config() {
319
		document.getElementById("showntpbox").innerHTML='';
320
		aodiv = document.getElementById('showntp');
321
		aodiv.style.display = "block";
322
	}
323

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

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