Project

General

Profile

Download (22.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	services_unbound.php
5
	part of the pfSense project (https://www.pfsense.org)
6
	Copyright (C) 2014	Warren Baker (warren@pfsense.org)
7
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
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_MODULE:	dnsresolver
33
*/
34

    
35
##|+PRIV
36
##|*IDENT=page-services-unbound
37
##|*NAME=Services: DNS Resolver page
38
##|*DESCR=Allow access to the 'Services: DNS Resolver' page.
39
##|*MATCH=services_unbound.php*
40
##|-PRIV
41

    
42
require_once("guiconfig.inc");
43
require_once("unbound.inc");
44
require_once("system.inc");
45

    
46
if (!is_array($config['unbound'])) {
47
	$config['unbound'] = array();
48
}
49

    
50
$a_unboundcfg =& $config['unbound'];
51

    
52
if (!is_array($config['unbound']['hosts'])) {
53
	$config['unbound']['hosts'] = array();
54
}
55

    
56
$a_hosts =& $config['unbound']['hosts'];
57

    
58
if (!is_array($config['unbound']['domainoverrides'])) {
59
	$config['unbound']['domainoverrides'] = array();
60
}
61

    
62
$a_domainOverrides = &$config['unbound']['domainoverrides'];
63

    
64
if (isset($config['unbound']['enable'])) {
65
	$pconfig['enable'] = true;
66
}
67
if (isset($config['unbound']['dnssec'])) {
68
	$pconfig['dnssec'] = true;
69
}
70
if (isset($config['unbound']['forwarding'])) {
71
	$pconfig['forwarding'] = true;
72
}
73
if (isset($config['unbound']['regdhcp'])) {
74
	$pconfig['regdhcp'] = true;
75
}
76
if (isset($config['unbound']['regdhcpstatic'])) {
77
	$pconfig['regdhcpstatic'] = true;
78
}
79
if (isset($config['unbound']['txtsupport'])) {
80
	$pconfig['txtsupport'] = true;
81
}
82

    
83
$pconfig['port'] = $config['unbound']['port'];
84
$pconfig['custom_options'] = $config['unbound']['custom_options'];
85

    
86
if (empty($config['unbound']['active_interface'])) {
87
	$pconfig['active_interface'] = array();
88
} else {
89
	$pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
90
}
91
if (empty($config['unbound']['outgoing_interface'])) {
92
	$pconfig['outgoing_interface'] = array();
93
} else {
94
	$pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
95
}
96

    
97
if ($_POST) {
98
	$pconfig = $_POST;
99
	unset($input_errors);
100

    
101
	if ($_POST['apply']) {
102
		$retval = services_unbound_configure();
103
		$savemsg = get_std_save_message($retval);
104
		if ($retval == 0) {
105
			clear_subsystem_dirty('unbound');
106
		}
107
		/* Update resolv.conf in case the interface bindings exclude localhost. */
108
		system_resolvconf_generate();
109
		/* Start or restart dhcpleases when it's necessary */
110
		system_dhcpleases_configure();
111
	} else {
112
		if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) {
113
			$input_errors[] = "The DNS Forwarder is enabled. Disable it before enabling the DNS Resolver.";
114
		}
115

    
116
		if (empty($_POST['active_interface'])) {
117
			$input_errors[] = "One or more Network Interfaces must be selected for binding.";
118
		} else if (!isset($config['system']['dnslocalhost']) && (!in_array("lo0", $_POST['active_interface']) && !in_array("all", $_POST['active_interface']))) {
119
			$input_errors[] = "This system is configured to use the DNS Resolver as its DNS server, so Localhost or All must be selected in Network Interfaces.";
120
		}
121

    
122
		if (empty($_POST['outgoing_interface'])) {
123
			$input_errors[] = "One or more Outgoing Network Interfaces must be selected.";
124
		}
125

    
126
		if ($_POST['port']) {
127
			if (is_port($_POST['port'])) {
128
				$a_unboundcfg['port'] = $_POST['port'];
129
			} else {
130
				$input_errors[] = gettext("You must specify a valid port number.");
131
			}
132
		} else if (isset($config['unbound']['port'])) {
133
			unset($config['unbound']['port']);
134
		}
135

    
136
		if (isset($_POST['enable'])) {
137
			$a_unboundcfg['enable'] = true;
138
		} else {
139
			unset($a_unboundcfg['enable']);
140
		}
141
		if (isset($_POST['dnssec'])) {
142
			$a_unboundcfg['dnssec'] = true;
143
		} else {
144
			unset($a_unboundcfg['dnssec']);
145
		}
146
		if (isset($_POST['forwarding'])) {
147
			$a_unboundcfg['forwarding'] = true;
148
		} else {
149
			unset($a_unboundcfg['forwarding']);
150
		}
151
		if (isset($_POST['regdhcp'])) {
152
			$a_unboundcfg['regdhcp'] = true;
153
		} else {
154
			unset($a_unboundcfg['regdhcp']);
155
		}
156
		if (isset($_POST['regdhcpstatic'])) {
157
			$a_unboundcfg['regdhcpstatic'] = true;
158
		} else {
159
			unset($a_unboundcfg['regdhcpstatic']);
160
		}
161
		if (isset($_POST['txtsupport'])) {
162
			$a_unboundcfg['txtsupport'] = true;
163
		} else {
164
			unset($a_unboundcfg['txtsupport']);
165
		}
166
		if (is_array($_POST['active_interface']) && !empty($_POST['active_interface'])) {
167
			$a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']);
168
		}
169

    
170
		if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface'])) {
171
			$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
172
		}
173

    
174
		$a_unboundcfg['custom_options'] = str_replace("\r\n", "\n", $_POST['custom_options']);
175

    
176
		if (!$input_errors) {
177
			write_config("DNS Resolver configured.");
178
			mark_subsystem_dirty('unbound');
179
		}
180
	}
181
}
182

    
183
if ($_GET['act'] == "del") {
184
	if ($_GET['type'] == 'host') {
185
		if ($a_hosts[$_GET['id']]) {
186
			unset($a_hosts[$_GET['id']]);
187
			write_config();
188
			mark_subsystem_dirty('unbound');
189
			header("Location: services_unbound.php");
190
			exit;
191
		}
192
	} elseif ($_GET['type'] == 'doverride') {
193
		if ($a_domainOverrides[$_GET['id']]) {
194
			unset($a_domainOverrides[$_GET['id']]);
195
			write_config();
196
			mark_subsystem_dirty('unbound');
197
			header("Location: services_unbound.php");
198
			exit;
199
		}
200
	}
201
}
202

    
203
$closehead = false;
204
$pgtitle = array(gettext("Services"),gettext("DNS Resolver"));
205
$shortcut_section = "resolver";
206
include_once("head.inc");
207

    
208
?>
209

    
210
<script type="text/javascript">
211
//<![CDATA[
212
function enable_change(enable_over) {
213
	var endis;
214
	endis = !(jQuery('#enable').is(":checked") || enable_over);
215
	jQuery("#active_interface,#outgoing_interface,#dnssec,#forwarding,#regdhcp,#regdhcpstatic,#dhcpfirst,#port,#txtsupport,#custom_options").prop('disabled', endis);
216
}
217
function show_advanced_dns() {
218
	jQuery("#showadv").show();
219
	jQuery("#showadvbox").hide();
220
}
221
//]]>
222
</script>
223
</head>
224

    
225
<body>
226
<?php include("fbegin.inc"); ?>
227
<form action="services_unbound.php" method="post" name="iform" id="iform">
228
<?php if ($input_errors) print_input_errors($input_errors); ?>
229
<?php if ($savemsg) print_info_box($savemsg); ?>
230
<?php if (is_subsystem_dirty('unbound')): ?><br/>
231
<?php print_info_box_np(gettext("The configuration of the DNS Resolver has been changed") . ".<br />" . gettext("You must apply changes for them to take effect."));?><br />
232
<?php endif; ?>
233
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="services unbound">
234
	<tbody>
235
		<tr>
236
			<td class="tabnavtbl">
237
				<?php
238
					$tab_array = array();
239
					$tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
240
					$tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
241
					$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
242
					display_top_tabs($tab_array, true);
243
				?>
244
			</td>
245
		</tr>
246
		<tr>
247
			<td id="mainarea">
248
				<div class="tabcont">
249
					<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
250
						<tbody>
251
							<tr>
252
								<td colspan="2" valign="top" class="listtopic"><?=gettext("General DNS Resolver Options");?></td>
253
							</tr>
254
							<tr>
255
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Enable");?></td>
256
								<td width="78%" class="vtable"><p>
257
									<input name="enable" type="checkbox" id="enable" value="yes" <?php if (isset($pconfig['enable'])) echo "checked=\"checked\"";?> onclick="enable_change(false)" />
258
									<strong><?=gettext("Enable DNS Resolver");?><br />
259
									</strong></p>
260
								</td>
261
							</tr>
262
							<tr>
263
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Listen Port");?></td>
264
								<td width="78%" class="vtable">
265
									<p>
266
										<input name="port" type="text" id="port" size="6" <?php if ($pconfig['port']) echo "value=\"{$pconfig['port']}\"";?> />
267
										<br /><br />
268
										<?=gettext("The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.");?>
269
									</p>
270
								</td>
271
							</tr>
272
							<tr>
273
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Network Interfaces"); ?></td>
274
								<td width="78%" class="vtable">
275
									<?php
276
										$interface_addresses = get_possible_listen_ips(false);
277
										$size=count($interface_addresses)+1;
278
									?>
279
									<?=gettext("Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. The default behavior is to respond to queries on every available IPv4 and IPv6 address.");?>
280
									<br /><br />
281
									<select id="active_interface" name="active_interface[]" multiple="multiple" size="<?php echo $size; ?>">
282
										<option value="all" <?php if (empty($pconfig['active_interface']) || empty($pconfig['active_interface'][0]) || in_array("all", $pconfig['active_interface'], true)) echo 'selected="selected"'; ?>>All</option>
283
										<?php
284
											foreach ($interface_addresses as $laddr):
285
												$selected = "";
286
												if (in_array($laddr['value'], $pconfig['active_interface']))
287
													$selected = 'selected="selected"';
288
										?>
289
										<option value="<?=$laddr['value'];?>" <?=$selected;?>>
290
											<?=htmlspecialchars($laddr['name']);?>
291
										</option>
292
										<?php endforeach; ?>
293
									</select>
294
									<br /><br />
295
								</td>
296
							</tr>
297
							<tr>
298
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Outgoing Network Interfaces"); ?></td>
299
								<td width="78%" class="vtable">
300
									<?php
301
										$interface_addresses = get_possible_listen_ips(false);
302
										$size=count($interface_addresses)+1;
303
									?>
304
									<?=gettext("Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.");?>
305
									<br /><br />
306
									<select id="outgoing_interface" name="outgoing_interface[]" multiple="multiple" size="<?php echo $size; ?>">
307
										<option value="" <?php if (empty($pconfig['outgoing_interface']) || empty($pconfig['outgoing_interface'][0])) echo 'selected="selected"'; ?>>All</option>
308
										<?php
309
											foreach ($interface_addresses as $laddr):
310
												$selected = "";
311
												if (in_array($laddr['value'], $pconfig['outgoing_interface']))
312
												$selected = 'selected="selected"';
313
										?>
314
										<option value="<?=$laddr['value'];?>" <?=$selected;?>>
315
											<?=htmlspecialchars($laddr['name']);?>
316
										</option>
317
										<?php endforeach; ?>
318
									</select>
319
									<br /><br />
320
								</td>
321
							</tr>
322
							<tr>
323
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNSSEC");?></td>
324
								<td width="78%" class="vtable"><p>
325
									<input name="dnssec" type="checkbox" id="dnssec" value="yes" <?php echo (isset($pconfig['dnssec']) ? "checked=\"checked\"" : "");?> />
326
									<strong><?=gettext("Enable DNSSEC Support");?><br />
327
									</strong></p>
328
								</td>
329
							</tr>
330
							<tr>
331
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DNS Query Forwarding");?></td>
332
								<td width="78%" class="vtable"><p>
333
									<input name="forwarding" type="checkbox" id="forwarding" value="yes" <?php echo (isset($pconfig['forwarding']) ? "checked=\"checked\"" : "");?> />
334
									<strong><?=gettext("Enable Forwarding Mode");?></strong><br /></p>
335
								</td>
336
							</tr>
337
							<tr>
338
								<td width="22%" valign="top" class="vncellreq"><?=gettext("DHCP Registration");?></td>
339
								<td width="78%" class="vtable"><p>
340
									<input name="regdhcp" type="checkbox" id="regdhcp" value="yes" <?php if (isset($pconfig['regdhcp'])) echo "checked=\"checked\"";?> />
341
									<strong><?=gettext("Register DHCP leases in the DNS Resolver");?><br />
342
									</strong><?php printf(gettext("If this option is set, then machines that specify".
343
									" their hostname when requesting a DHCP lease will be registered".
344
									" in the DNS Resolver, so that their name can be resolved.".
345
									" You should also set the domain in %sSystem:".
346
									" General setup%s to the proper value."),'<a href="system.php">','</a>')?></p>
347
								</td>
348
							</tr>
349
							<tr>
350
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Static DHCP");?></td>
351
								<td width="78%" class="vtable"><p>
352
									<input name="regdhcpstatic" type="checkbox" id="regdhcpstatic" value="yes" <?php if (isset($pconfig['regdhcpstatic'])) echo "checked=\"checked\"";?> />
353
									<strong><?=gettext("Register DHCP static mappings in the DNS Resolver");?><br />
354
									</strong><?php printf(gettext("If this option is set, then DHCP static mappings will ".
355
											"be registered in the DNS Resolver, so that their name can be ".
356
											"resolved. You should also set the domain in %s".
357
											"System: General setup%s to the proper value."),'<a href="system.php">','</a>');?></p>
358
								</td>
359
							</tr>
360
							<tr>
361
								<td width="22%" valign="top" class="vncellreq"><?=gettext("TXT Comment Support");?></td>
362
								<td width="78%" class="vtable"><p>
363
									<input name="txtsupport" type="checkbox" id="txtsupport" value="yes" <?php echo (isset($pconfig['txtsupport']) ? "checked=\"checked\"" : "");?> />
364
									<strong><?=gettext("If this option is set, then any descriptions associated with Host entries and DHCP Static mappings will create a corresponding TXT record.");?><br />
365
									</strong></p>
366
								</td>
367
							</tr>
368
							<tr>
369
								<td width="22%" valign="top" class="vncellreq"><?=gettext("Advanced");?></td>
370
								<td width="78%" class="vtable">
371
									<div id="showadvbox" <?php if ($pconfig['custom_options']) echo "style='display:none'"; ?>>
372
										<input type="button" onclick="show_advanced_dns()" value="<?=gettext("Advanced"); ?>" /> - <?=gettext("Show advanced option");?>
373
									</div>
374
									<div id="showadv" <?php if (empty($pconfig['custom_options'])) echo "style='display:none'"; ?>>
375
										<strong><?=gettext("Advanced");?><br /></strong>
376
										<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=htmlspecialchars($pconfig['custom_options']);?></textarea><br />
377
										<?=gettext("Enter any additional configuration parameters to add to the DNS Resolver configuration here, separated by a newline"); ?><br />
378
									</div>
379
								</td>
380
							</tr>
381
							<tr>
382
								<td colspan="2">
383
									<input name="submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true)" />
384
								</td>
385
							</tr>
386
						</tbody>
387
					</table>
388
				</div>
389
			</td>
390
		</tr>
391
	</tbody>
392
</table>
393

    
394

    
395
<p><span class="vexpl"><span class="red"><strong><?=gettext("Note:");?><br />
396
</strong></span><?php printf(gettext("If the DNS Resolver is enabled, the DHCP".
397
" service (if enabled) will automatically serve the LAN IP".
398
" address as a DNS server to DHCP clients so they will use".
399
" the DNS Resolver. If Forwarding, is enabled, the DNS Resolver will use the DNS servers".
400
" entered in %sSystem: General setup%s".
401
" or those obtained via DHCP or PPP on WAN if the &quot;Allow".
402
" DNS server list to be overridden by DHCP/PPP on WAN&quot;".
403
" is checked."),'<a href="system.php">','</a>');?><br />
404
</span></p>
405

    
406
&nbsp;<br />
407
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="host overrides">
408
<tr>
409
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Host Overrides");?></td>
410
</tr>
411
<tr>
412
	<td><br />
413
	<?=gettext("Entries in this section override individual results from the forwarders.");?>
414
	<?=gettext("Use these for changing DNS results or for adding custom DNS records.");?>
415
	</td>
416
</tr>
417
</table>
418
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
419
	<thead>
420
	<tr>
421
		<td width="20%" class="listhdrr"><?=gettext("Host");?></td>
422
		<td width="25%" class="listhdrr"><?=gettext("Domain");?></td>
423
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
424
		<td width="30%" class="listhdr"><?=gettext("Description");?></td>
425
		<td width="5%" class="list">
426
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
427
				<tr>
428
					<td width="17"></td>
429
					<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
430
				</tr>
431
			</table>
432
		</td>
433
	</tr>
434
	</thead>
435
	<tfoot>
436
	<tr>
437
		<td class="list" colspan="4"></td>
438
		<td class="list">
439
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
440
				<tr>
441
					<td width="17"></td>
442
					<td valign="middle"><a href="services_unbound_host_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
443
				</tr>
444
			</table>
445
		</td>
446
	</tr>
447
	</tfoot>
448
	<tbody>
449
	<?php $i = 0; foreach ($a_hosts as $hostent): ?>
450
	<tr>
451
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
452
			<?=strtolower($hostent['host']);?>&nbsp;
453
		</td>
454
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
455
			<?=strtolower($hostent['domain']);?>&nbsp;
456
		</td>
457
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
458
			<?=$hostent['ip'];?>&nbsp;
459
		</td>
460
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
461
			<?=htmlspecialchars($hostent['descr']);?>&nbsp;
462
		</td>
463
		<td valign="middle" class="list nowrap">
464
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
465
				<tr>
466
					<td valign="middle"><a href="services_unbound_host_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a></td>
467
					<td><a href="services_unbound.php?type=host&amp;act=del&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this host?");?>')"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" /></a></td>
468
				</tr>
469
			</table>
470
	</tr>
471
	<?php if ($hostent['aliases']['item'] && is_array($hostent['aliases']['item'])): ?>
472
	<?php foreach ($hostent['aliases']['item'] as $alias): ?>
473
	<tr>
474
		<td class="listlr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
475
			<?=strtolower($alias['host']);?>&nbsp;
476
		</td>
477
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
478
			<?=strtolower($alias['domain']);?>&nbsp;
479
		</td>
480
		<td class="listr" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
481
			Alias for <?=$hostent['host'] ? $hostent['host'] . '.' . $hostent['domain'] : $hostent['domain'];?>&nbsp;
482
		</td>
483
		<td class="listbg" ondblclick="document.location='services_unbound_host_edit.php?id=<?=$i;?>';">
484
			<?=htmlspecialchars($alias['description']);?>&nbsp;
485
		</td>
486
		<td valign="middle" class="list nowrap">
487
			<a href="services_unbound_host_edit.php?id=<?=$i;?>"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" /></a>
488
		</td>
489
	</tr>
490
	<?php endforeach; ?>
491
	<?php endif; ?>
492
	<?php $i++; endforeach; ?>
493
	<tr style="display:none"><td></td></tr>
494
	</tbody>
495
</table>
496
<br />
497
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont" summary="domain overrides">
498
<tr>
499
	<td colspan="5" valign="top" class="listtopic"><?=gettext("Domain Overrides");?></td>
500
</tr>
501
<tr>
502
	<td><p><?=gettext("Entries in this area override an entire domain by specifying an".
503
	" authoritative DNS server to be queried for that domain.");?></p></td>
504
</tr>
505
</table>
506
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tabcont sortable" summary="results">
507
	<thead>
508
	<tr>
509
		<td width="35%" class="listhdrr"><?=gettext("Domain");?></td>
510
		<td width="20%" class="listhdrr"><?=gettext("IP");?></td>
511
		<td width="40%" class="listhdr"><?=gettext("Description");?></td>
512
		<td width="5%" class="list">
513
			<table border="0" cellspacing="0" cellpadding="1" summary="add">
514
				<tr>
515
					<td width="17" height="17"></td>
516
					<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
517
				</tr>
518
			</table>
519
		</td>
520
	</tr>
521
	</thead>
522
	<tfoot>
523
	<tr>
524
		<td class="list" colspan="3"></td>
525
		<td class="list">
526
		<table border="0" cellspacing="0" cellpadding="1" summary="add">
527
			<tr>
528
				<td width="17" height="17"></td>
529
				<td><a href="services_unbound_domainoverride_edit.php"><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" width="17" height="17" border="0" alt="add" /></a></td>
530
			</tr>
531
		</table>
532
		</td>
533
	</tr>
534
	</tfoot>
535
	<tbody>
536
	<?php $i = 0; foreach ($a_domainOverrides as $doment): ?>
537
	<tr>
538
		<td class="listlr">
539
			<?=strtolower($doment['domain']);?>&nbsp;
540
		</td>
541
		<td class="listr">
542
			<?=$doment['ip'];?>&nbsp;
543
		</td>
544
		<td class="listbg">
545
			<?=htmlspecialchars($doment['descr']);?>&nbsp;
546
		</td>
547
		<td valign="middle" class="list nowrap">
548
			<table border="0" cellspacing="0" cellpadding="1" summary="icons">
549
				<tr>
550
					<td valign="middle"><a href="services_unbound_domainoverride_edit.php?id=<?=$i;?>">
551
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_e.gif" width="17" height="17" border="0" alt="edit" />
552
					</a></td>
553
					<td valign="middle"><a href="services_unbound.php?act=del&amp;type=doverride&amp;id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this domain override?");?>')">
554
						<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_x.gif" width="17" height="17" border="0" alt="delete" />
555
					</a></td>
556
				</tr>
557
			</table>
558
		</td>
559
	</tr>
560
	<?php $i++; endforeach; ?>
561
	<tr style="display:none"><td></td></tr>
562
	</tbody>
563
</table>
564
</form>
565
<script type="text/javascript">
566
//<![CDATA[
567
enable_change(false);
568
//]]>
569
</script>
570
<?php include("fend.inc"); ?>
571
</body>
572
</html>
(170-170/256)