Project

General

Profile

Download (19.1 KB) Statistics
| Branch: | Tag: | Revision:
1 5b237745 Scott Ullrich
#!/usr/local/bin/php
2
<?php 
3 b46bfcf5 Bill Marquette
/* $Id$ */
4 5b237745 Scott Ullrich
/*
5
	services_dhcp.php
6
	part of m0n0wall (http://m0n0.ch/wall)
7
	
8
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
9
	All rights reserved.
10
	
11
	Redistribution and use in source and binary forms, with or without
12
	modification, are permitted provided that the following conditions are met:
13
	
14
	1. Redistributions of source code must retain the above copyright notice,
15
	   this list of conditions and the following disclaimer.
16
	
17
	2. Redistributions in binary form must reproduce the above copyright
18
	   notice, this list of conditions and the following disclaimer in the
19
	   documentation and/or other materials provided with the distribution.
20
	
21
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
25
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
	POSSIBILITY OF SUCH DAMAGE.
31
*/
32
33 b7597d4e Bill Marquette
require("guiconfig.inc");
34 5b237745 Scott Ullrich
35
$if = $_GET['if'];
36
if ($_POST['if'])
37
	$if = $_POST['if'];
38
	
39
$iflist = array("lan" => "LAN");
40
41
for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
42
	$oc = $config['interfaces']['opt' . $i];
43
	
44
	if (isset($oc['enable']) && $oc['if'] && (!$oc['bridge'])) {
45
		$iflist['opt' . $i] = $oc['descr'];
46
	}
47
}
48
49
if (!$if || !isset($iflist[$if]))
50
	$if = "lan";
51
52
$pconfig['range_from'] = $config['dhcpd'][$if]['range']['from'];
53
$pconfig['range_to'] = $config['dhcpd'][$if]['range']['to'];
54
$pconfig['deftime'] = $config['dhcpd'][$if]['defaultleasetime'];
55
$pconfig['maxtime'] = $config['dhcpd'][$if]['maxleasetime'];
56 31c59d0d Scott Ullrich
$pconfig['gateway'] = $config['dhcpd'][$if]['gateway'];
57 5b237745 Scott Ullrich
list($pconfig['wins1'],$pconfig['wins2']) = $config['dhcpd'][$if]['winsserver'];
58 06d754d4 Scott Ullrich
list($pconfig['dns1'],$pconfig['dns2']) = $config['dhcpd'][$if]['dnsserver'];
59 5b237745 Scott Ullrich
$pconfig['enable'] = isset($config['dhcpd'][$if]['enable']);
60
$pconfig['denyunknown'] = isset($config['dhcpd'][$if]['denyunknown']);
61 80933129 Bill Marquette
$pconfig['staticarp'] = isset($config['dhcpd'][$if]['staticarp']);
62 ea166a33 Scott Ullrich
$pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip'];
63 31c59d0d Scott Ullrich
64 5b237745 Scott Ullrich
$ifcfg = $config['interfaces'][$if];
65
66
if (!is_array($config['dhcpd'][$if]['staticmap'])) {
67
	$config['dhcpd'][$if]['staticmap'] = array();
68
}
69
staticmaps_sort($if);
70
$a_maps = &$config['dhcpd'][$if]['staticmap'];
71
72 0ea7462d Bill Marquette
function is_inrange($test, $start, $end) {
73 dd5b2ec6 Bill Marquette
	if ( (ip2long($test) < ip2long($end)) && (ip2long($test) > ip2long($start)) )
74 0ea7462d Bill Marquette
		return true;
75
	else
76
		return false;
77
}
78 b7597d4e Bill Marquette
79 5b237745 Scott Ullrich
if ($_POST) {
80
81
	unset($input_errors);
82 b7597d4e Bill Marquette
83 5b237745 Scott Ullrich
	$pconfig = $_POST;
84
85
	/* input validation */
86
	if ($_POST['enable']) {
87
		$reqdfields = explode(" ", "range_from range_to");
88
		$reqdfieldsn = explode(",", "Range begin,Range end");
89
		
90
		do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
91 0ea7462d Bill Marquette
92
		foreach($a_maps as $mapent) {
93
			if(is_inrange($mapent['ipaddr'], $_POST['range_from'], $_POST['range_to'])) {
94
				$input_errors[] = "{$mapent['ipaddr']} is inside the range you specified.";
95
			}
96
97
		}
98 5b237745 Scott Ullrich
		
99
		if (($_POST['range_from'] && !is_ipaddr($_POST['range_from']))) {
100
			$input_errors[] = "A valid range must be specified.";
101
		}
102
		if (($_POST['range_to'] && !is_ipaddr($_POST['range_to']))) {
103
			$input_errors[] = "A valid range must be specified.";
104
		}
105 f9261419 Bill Marquette
		if (($_POST['gateway'] && !is_ipaddr($_POST['gateway'])))
106
			$input_errors[] = "A valid IP address must be specified for the gateway.";
107 5b237745 Scott Ullrich
		if (($_POST['wins1'] && !is_ipaddr($_POST['wins1'])) || ($_POST['wins2'] && !is_ipaddr($_POST['wins2']))) {
108 4cab31d0 Scott Ullrich
			$input_errors[] = "A valid IP address must be specified for the primary/secondary WINS servers.";
109
		}
110
		if (($_POST['dns1'] && !is_ipaddr($_POST['dns1'])) || ($_POST['dns2'] && !is_ipaddr($_POST['dns2']))) {
111
			$input_errors[] = "A valid IP address must be specified for the primary/secondary DNS servers.";
112 5b237745 Scott Ullrich
		}
113
		if ($_POST['deftime'] && (!is_numeric($_POST['deftime']) || ($_POST['deftime'] < 60))) {
114
			$input_errors[] = "The default lease time must be at least 60 seconds.";
115
		}
116
		if ($_POST['maxtime'] && (!is_numeric($_POST['maxtime']) || ($_POST['maxtime'] < 60) || ($_POST['maxtime'] <= $_POST['deftime']))) {
117
			$input_errors[] = "The maximum lease time must be at least 60 seconds and higher than the default lease time.";
118
		}
119
		
120
		if (!$input_errors) {
121
			/* make sure the range lies within the current subnet */
122
			$subnet_start = (ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));
123
			$subnet_end = (ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet'])));
124
			
125
			if ((ip2long($_POST['range_from']) < $subnet_start) || (ip2long($_POST['range_from']) > $subnet_end) ||
126
			    (ip2long($_POST['range_to']) < $subnet_start) || (ip2long($_POST['range_to']) > $subnet_end)) {
127
				$input_errors[] = "The specified range lies outside of the current subnet.";	
128
			}
129
			
130
			if (ip2long($_POST['range_from']) > ip2long($_POST['range_to']))
131
				$input_errors[] = "The range is invalid (first element higher than second element).";
132
			
133
			/* make sure that the DHCP Relay isn't enabled on this interface */
134
			if (isset($config['dhcrelay'][$if]['enable']))
135
				$input_errors[] = "You must disable the DHCP relay on the {$iflist[$if]} interface before enabling the DHCP server.";
136
		}
137
	}
138
139
	if (!$input_errors) {
140
		$config['dhcpd'][$if]['range']['from'] = $_POST['range_from'];
141
		$config['dhcpd'][$if]['range']['to'] = $_POST['range_to'];
142
		$config['dhcpd'][$if]['defaultleasetime'] = $_POST['deftime'];
143
		$config['dhcpd'][$if]['maxleasetime'] = $_POST['maxtime'];
144
		$config['dhcpd'][$if]['enable'] = $_POST['enable'] ? true : false;
145
		$config['dhcpd'][$if]['denyunknown'] = $_POST['denyunknown'] ? true : false;
146 ea166a33 Scott Ullrich
		$config['dhcpd'][$if]['failover_peerip'] = $_POST['failover_peerip'];
147
				
148 5b237745 Scott Ullrich
		unset($config['dhcpd'][$if]['winsserver']);
149
		if ($_POST['wins1'])
150
			$config['dhcpd'][$if]['winsserver'][] = $_POST['wins1'];
151
		if ($_POST['wins2'])
152
			$config['dhcpd'][$if]['winsserver'][] = $_POST['wins2'];
153 4cab31d0 Scott Ullrich
154 94a9cf1a Scott Ullrich
		unset($config['dhcpd'][$if]['dnsserver']);
155
156
		if ($_POST['dns1']) 		
157 06d754d4 Scott Ullrich
			$config['dhcpd'][$if]['dnsserver'][] = $_POST['dns1'];
158 94a9cf1a Scott Ullrich
		if ($_POST['dns2']) 
159 06d754d4 Scott Ullrich
			$config['dhcpd'][$if]['dnsserver'][] = $_POST['dns2'];
160 5b237745 Scott Ullrich
			
161 f9261419 Bill Marquette
		$config['dhcpd'][$if]['gateway'] = $_POST['gateway'];
162
163 80933129 Bill Marquette
		$config['dhcpd'][$if]['staticarp'] = $_POST['staticarp'] ? true : false;
164
	
165 9c748b70 Scott Ullrich
166 5b237745 Scott Ullrich
		write_config();
167 80933129 Bill Marquette
168
		/* static arp configuration */
169
                if (isset($config['dhcpd'][$if]['staticarp']))
170
			interfaces_staticarp_configure($if);
171 5b237745 Scott Ullrich
		
172
		$retval = 0;
173 824edb6c Scott Ullrich
		config_lock();
174
		$retval = services_dhcpd_configure();
175
		config_unlock();
176 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
177
	}
178
}
179
180
if ($_GET['act'] == "del") {
181
	if ($a_maps[$_GET['id']]) {
182
		unset($a_maps[$_GET['id']]);
183
		write_config();
184
		header("Location: services_dhcp.php?if={$if}");
185
		exit;
186
	}
187
}
188 4df96eff Scott Ullrich
189
$pgtitle = "Services: DHCP server";
190
include("head.inc");
191
192 5b237745 Scott Ullrich
?>
193 4df96eff Scott Ullrich
194 5b237745 Scott Ullrich
<script language="JavaScript">
195
<!--
196
function enable_change(enable_over) {
197 07bd3f83 Scott Ullrich
	var endis;
198
	endis = !(document.iform.enable.checked || enable_over);
199
	document.iform.range_from.disabled = endis;
200
	document.iform.range_to.disabled = endis;
201
	document.iform.wins1.disabled = endis;
202
	document.iform.wins2.disabled = endis;
203 4cab31d0 Scott Ullrich
	document.iform.dns1.disabled = endis;
204
	document.iform.dns2.disabled = endis;
205 07bd3f83 Scott Ullrich
	document.iform.deftime.disabled = endis;
206
	document.iform.maxtime.disabled = endis;
207 f9261419 Bill Marquette
	document.iform.gateway.disabled = endis;
208 fcffbd13 Scott Ullrich
	document.iform.failover_peerip.disabled = endis;
209 db6b2be4 Scott Ullrich
	document.iform.staticarp.disabled = endis;
210 7ceb4368 Scott Ullrich
	document.iform.denyunknown.disabled = endis;
211 5b237745 Scott Ullrich
}
212
//-->
213
</script>
214
215
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
216 b7597d4e Bill Marquette
<?php include("fbegin.inc"); ?>
217 74f446e8 Bill Marquette
<p class="pgtitle"><?=$pgtitle?></p>
218 5b237745 Scott Ullrich
<form action="services_dhcp.php" method="post" name="iform" id="iform">
219
<?php if ($input_errors) print_input_errors($input_errors); ?>
220
<?php if ($savemsg) print_info_box($savemsg); ?>
221
<?php if (file_exists($d_staticmapsdirty_path)): ?><p>
222
<?php print_info_box_np("The static mapping configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br>
223
<?php endif; ?>
224
<table width="100%" border="0" cellpadding="0" cellspacing="0">
225
  <tr><td>
226 f0cdf141 Scott Ullrich
  <?php
227
	/* active tabs */
228
	$tab_array = array();
229
	$tabscounter = 0;
230
	$i = 0;
231
	foreach ($iflist as $ifent => $ifname) {
232
		if ($ifent == $if)
233
			$active = true;
234
		else
235
			$active = false;
236
		$tab_array[] = array($ifname, $active, "services_dhcp.php?if={$ifent}");
237
	}
238
	display_top_tabs($tab_array);
239
  ?>
240 5b237745 Scott Ullrich
  </td></tr>
241
  <tr> 
242 d732f186 Bill Marquette
    <td>
243
	<div id="mainarea">
244
              <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
245 5b237745 Scott Ullrich
                      <tr> 
246
                        <td width="22%" valign="top" class="vtable">&nbsp;</td>
247
                        <td width="78%" class="vtable">
248
<input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
249
                          <strong>Enable DHCP server on 
250
                          <?=htmlspecialchars($iflist[$if]);?>
251
                          interface</strong></td>
252
                      </tr>
253
				  <tr>
254
	              <td width="22%" valign="top" class="vtable">&nbsp;</td>
255
                      <td width="78%" class="vtable">
256 7ceb4368 Scott Ullrich
<input name="denyunknown" id="denyunknown" type="checkbox" value="yes" <?php if ($pconfig['denyunknown']) echo "checked"; ?>>
257 5b237745 Scott Ullrich
                      <strong>Deny unknown clients</strong><br>
258
                      If this is checked, only the clients defined below will get DHCP leases from this server. </td>
259
		      		  </tr>
260
                      <tr> 
261
                        <td width="22%" valign="top" class="vncellreq">Subnet</td>
262
                        <td width="78%" class="vtable"> 
263
                          <?=gen_subnet($ifcfg['ipaddr'], $ifcfg['subnet']);?>
264
                        </td>
265
                      </tr>
266
                      <tr> 
267
                        <td width="22%" valign="top" class="vncellreq">Subnet 
268
                          mask</td>
269
                        <td width="78%" class="vtable"> 
270
                          <?=gen_subnet_mask($ifcfg['subnet']);?>
271
                        </td>
272
                      </tr>
273
                      <tr> 
274
                        <td width="22%" valign="top" class="vncellreq">Available 
275
                          range</td>
276
                        <td width="78%" class="vtable"> 
277
                          <?=long2ip(ip2long($ifcfg['ipaddr']) & gen_subnet_mask_long($ifcfg['subnet']));?>
278
                          - 
279
                          <?=long2ip(ip2long($ifcfg['ipaddr']) | (~gen_subnet_mask_long($ifcfg['subnet']))); ?>
280
                        </td>
281
                      </tr>
282
                      <tr> 
283
                        <td width="22%" valign="top" class="vncellreq">Range</td>
284
                        <td width="78%" class="vtable"> 
285
                          <input name="range_from" type="text" class="formfld" id="range_from" size="20" value="<?=htmlspecialchars($pconfig['range_from']);?>"> 
286 25e031a1 Scott Ullrich
                          &nbsp;to&nbsp; <input name="range_to" type="text" class="formfld" id="range_to" size="20" value="<?=htmlspecialchars($pconfig['range_to']);?>">
287
			</td>
288 5b237745 Scott Ullrich
                      </tr>
289
                      <tr> 
290
                        <td width="22%" valign="top" class="vncell">WINS servers</td>
291
                        <td width="78%" class="vtable"> 
292
                          <input name="wins1" type="text" class="formfld" id="wins1" size="20" value="<?=htmlspecialchars($pconfig['wins1']);?>"><br>
293 25e031a1 Scott Ullrich
                          <input name="wins2" type="text" class="formfld" id="wins2" size="20" value="<?=htmlspecialchars($pconfig['wins2']);?>">
294
			</td>
295 5b237745 Scott Ullrich
                      </tr>
296 4cab31d0 Scott Ullrich
                      <tr> 
297
                        <td width="22%" valign="top" class="vncell">DNS servers</td>
298
                        <td width="78%" class="vtable"> 
299
                          <input name="dns1" type="text" class="formfld" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>"><br>
300 25e031a1 Scott Ullrich
                          <input name="dns2" type="text" class="formfld" id="dns2" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>"><br>
301
			  NOTE: leave blank to use the system default DNS servers.  This option is handy when your doing CARP+DHCP Failover, etc.
302
			</td>
303 4cab31d0 Scott Ullrich
                      </tr>
304 b7597d4e Bill Marquette
                     <tr> 
305
                       <td width="22%" valign="top" class="vncell">Gateway</td>
306
                       <td width="78%" class="vtable"> 
307
                         <input name="gateway" type="text" class="formfld" id="gateway" size="20" value="<?=htmlspecialchars($pconfig['gateway']);?>"><br>
308 2af4c579 Scott Ullrich
			 The default is to use the IP of the firewall as the gateway.  Specify an alternate gateway here if this is not the correct gateway for your network.
309
			</td> 
310
                     </tr>
311 5b237745 Scott Ullrich
                      <tr> 
312
                        <td width="22%" valign="top" class="vncell">Default lease 
313
                          time</td>
314
                        <td width="78%" class="vtable"> 
315
                          <input name="deftime" type="text" class="formfld" id="deftime" size="10" value="<?=htmlspecialchars($pconfig['deftime']);?>">
316
                          seconds<br>
317
                          This is used for clients that do not ask for a specific 
318
                          expiration time.<br>
319 2af4c579 Scott Ullrich
                          The default is 7200 seconds.
320
			</td>
321 5b237745 Scott Ullrich
                      </tr>
322
                      <tr> 
323
                        <td width="22%" valign="top" class="vncell">Maximum lease 
324
                          time</td>
325
                        <td width="78%" class="vtable"> 
326
                          <input name="maxtime" type="text" class="formfld" id="maxtime" size="10" value="<?=htmlspecialchars($pconfig['maxtime']);?>">
327
                          seconds<br>
328
                          This is the maximum lease time for clients that ask 
329
                          for a specific expiration time.<br>
330 2af4c579 Scott Ullrich
                          The default is 86400 seconds.
331
			</td>
332 5b237745 Scott Ullrich
                      </tr>
333 ea166a33 Scott Ullrich
                      <tr>
334
                        <td width="22%" valign="top" class="vncell">Failover peer IP:</td>
335
                        <td width="78%" class="vtable">
336 fcffbd13 Scott Ullrich
				<input name="failover_peerip" type="text" class="formfld" id="failover_peerip" size="10" value="<?=htmlspecialchars($pconfig['failover_peerip']);?>"><br>
337 be586e5f Scott Ullrich
				Leave blank to disable.  Enter the REAL address of the other machine.  Machines must be using CARP.
338 ea166a33 Scott Ullrich
			</td>
339
		      </tr>
340 f1da88f6 Bill Marquette
                      <tr>
341
                        <td width="22%" valign="top" class="vncell">Static ARP</td>
342 e44a0096 Scott Ullrich
                        <td width="78%" class="vtable">
343
				<table>
344 2af4c579 Scott Ullrich
					<tr>
345
						<td>
346
							<input valign="middle" type="checkbox" value="yes" name="staticarp" id="staticarp" <?php if($pconfig['staticarp']) echo " checked"; ?>>&nbsp;
347
						</td>
348
						<td>
349
							<b>Enable Static ARP entries</b>
350
						</td>
351
					</tr>
352
					<tr>
353
						<td>
354
							&nbsp;
355
						</td>
356
						<td>
357
							<span class="red"><strong>Note:</strong></span> This feature is under development.  Only the machines listed below will be able to communicate with the firewall on this NIC.  Disabling this has been tested to be broken, a reboot will be required to disable.  Be warned!
358
						</td>
359
					</tr>
360 e44a0096 Scott Ullrich
				</table>
361
			</td>
362 f1da88f6 Bill Marquette
                      </tr>
363 5b237745 Scott Ullrich
                      <tr> 
364
                        <td width="22%" valign="top">&nbsp;</td>
365
                        <td width="78%"> 
366
                          <input name="if" type="hidden" value="<?=$if;?>"> 
367
                          <input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)"> 
368
                        </td>
369
                      </tr>
370
                      <tr> 
371
                        <td width="22%" valign="top">&nbsp;</td>
372
                        <td width="78%"> <p><span class="vexpl"><span class="red"><strong>Note:<br>
373
                            </strong></span>The DNS servers entered in <a href="system.php">System: 
374
                            General setup</a> (or the <a href="services_dnsmasq.php">DNS 
375
                            forwarder</a>, if enabled) </span><span class="vexpl">will 
376
                            be assigned to clients by the DHCP server.<br>
377
                            <br>
378
                            The DHCP lease table can be viewed on the <a href="diag_dhcp_leases.php">Diagnostics: 
379
                            DHCP leases</a> page.<br>
380 2af4c579 Scott Ullrich
                            </span></p>
381
			</td>
382 5b237745 Scott Ullrich
                      </tr>
383
                    </table>
384 d732f186 Bill Marquette
              <table class="tabcont" width="100%" border="0" cellpadding="0" cellspacing="0">
385 5b237745 Scott Ullrich
                <tr>
386 2af4c579 Scott Ullrich
                  <td width="35%" class="listhdrr">MAC address</td>
387 5b237745 Scott Ullrich
                  <td width="20%" class="listhdrr">IP address</td>
388
                  <td width="35%" class="listhdr">Description</td>
389 2af4c579 Scott Ullrich
                  <td width="10%" class="list">
390
		  </td>
391
		</tr>
392 5b237745 Scott Ullrich
			  <?php $i = 0; foreach ($a_maps as $mapent): ?>
393
                <tr>
394 2d165eff Bill Marquette
                  <td class="listlr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
395 5b237745 Scott Ullrich
                    <?=htmlspecialchars($mapent['mac']);?>
396
                  </td>
397 2d165eff Bill Marquette
                  <td class="listr" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
398 5b237745 Scott Ullrich
                    <?=htmlspecialchars($mapent['ipaddr']);?>&nbsp;
399
                  </td>
400 2d165eff Bill Marquette
                  <td class="listbg" ondblclick="document.location='services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>';">
401 588b7fc5 Bill Marquette
                    <font color="#FFFFFF"><?=htmlspecialchars($mapent['descr']);?>&nbsp;</font>
402 5b237745 Scott Ullrich
                  </td>
403 75a70796 Bill Marquette
                  <td valign="middle" nowrap class="list">
404
                    <table border="0" cellspacing="0" cellpadding="1">
405
                      <tr>
406 677c0869 Erik Kristensen
                        <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>&id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0"></a></td>
407
                        <td valign="middle"><a href="services_dhcp.php?if=<?=$if;?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this mapping?')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0"></a></td>
408 75a70796 Bill Marquette
                      </tr>
409
                    </table>
410
                  </td>
411
                </tr>
412
		<?php $i++; endforeach; ?>
413 5b237745 Scott Ullrich
                <tr> 
414
                  <td class="list" colspan="3"></td>
415 75a70796 Bill Marquette
                  <td class="list">
416
                    <table border="0" cellspacing="0" cellpadding="1">
417
                      <tr>
418 677c0869 Erik Kristensen
                        <td valign="middle"><a href="services_dhcp_edit.php?if=<?=$if;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0"></a></td>
419 75a70796 Bill Marquette
                      </tr>
420
                    </table>
421
                  </td>
422
                </tr>
423 5b237745 Scott Ullrich
              </table>
424 d732f186 Bill Marquette
	</div>
425 5b237745 Scott Ullrich
    </td>
426
  </tr>
427
</table>
428
</form>
429
<script language="JavaScript">
430
<!--
431
enable_change(false);
432
//-->
433
</script>
434 b7597d4e Bill Marquette
<?php include("fend.inc"); ?>
435 5b237745 Scott Ullrich
</body>
436
</html>