Project

General

Profile

« Previous | Next » 

Revision 2783e408

Added by Renato Botelho almost 11 years ago

Revert "Indent better"

This reverts commit a431bfc9e698c753d9a54218af9076184deb6251.

View differences:

usr/local/www/services_unbound.php
42 42
require_once("unbound.inc");
43 43

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

  
48 48
$a_unboundcfg =& $config['unbound'];
49 49

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

  
54 54
$a_hosts =& $config['unbound']['hosts'];
55 55

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

  
60 60
$a_domainOverrides = &$config['unbound']['domainoverrides'];
......
82 82
$pconfig['custom_options'] = $config['unbound']['custom_options'];
83 83

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

  
95 95
if ($_POST) {
96
    $pconfig = $_POST;
97
    unset($input_errors);
98

  
99
    if ($_POST['apply']) {
100
        $retval = services_unbound_configure();
101
        $savemsg = get_std_save_message($retval);
102
        if ($retval == 0) {
103
            clear_subsystem_dirty('unbound');
96
	$pconfig = $_POST;
97
	unset($input_errors);
98

  
99
	if ($_POST['apply']) {
100
		$retval = services_unbound_configure();
101
		$savemsg = get_std_save_message($retval);
102
		if ($retval == 0) {
103
			clear_subsystem_dirty('unbound');
104 104
        }
105
        /* Update resolv.conf in case the interface bindings exclude localhost. */
106
        system_resolvconf_generate();
107
    } else {
108
        if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) {
109
            $input_errors[] = "The system dns-forwarder is still active. Disable it before enabling the DNS Resolver.";
105
		/* Update resolv.conf in case the interface bindings exclude localhost. */
106
		system_resolvconf_generate();
107
	} else {
108
		if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) {
109
			$input_errors[] = "The system dns-forwarder is still active. Disable it before enabling the DNS Resolver.";
110 110
        }
111 111

  
112
        if (empty($_POST['active_interface'])) {
113
            $input_errors[] = "A single network interface needs to be selected for the DNS Resolver to bind to.";
112
		if (empty($_POST['active_interface'])) {
113
			$input_errors[] = "A single network interface needs to be selected for the DNS Resolver to bind to.";
114 114
        }
115 115

  
116
        if (empty($_POST['outgoing_interface'])) {
117
            $input_errors[] = "A single outgoing network interface needs to be selected for the DNS Resolver to use for outgoing DNS requests.";
116
		if (empty($_POST['outgoing_interface'])) {
117
			$input_errors[] = "A single outgoing network interface needs to be selected for the DNS Resolver to use for outgoing DNS requests.";
118 118
        }
119 119

  
120
        if ($_POST['port']) {
121
            if (is_port($_POST['port'])) {
122
                $a_unboundcfg['port'] = $_POST['port'];
120
		if ($_POST['port']) {
121
			if (is_port($_POST['port'])) {
122
				$a_unboundcfg['port'] = $_POST['port'];
123 123
            } else {
124
                $input_errors[] = gettext("You must specify a valid port number.");
124
				$input_errors[] = gettext("You must specify a valid port number.");
125 125
            }
126 126
        } else if (isset($config['unbound']['port'])) {
127
            unset($config['unbound']['port']);
127
			unset($config['unbound']['port']);
128 128
        }
129 129

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

  
164
        if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface'])) {
165
            $a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
164
		if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface'])) {
165
			$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
166 166
        }
167 167

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

  
170
        if (!$input_errors) {
171
            write_config("DNS Resolver configured.");
172
            mark_subsystem_dirty('unbound');
173
        }
174
    }
170
		if (!$input_errors) {
171
			write_config("DNS Resolver configured.");
172
			mark_subsystem_dirty('unbound');
173
		}
174
	}
175 175
}
176 176

  
177 177
if ($_GET['act'] == "del") {
178
    if ($_GET['type'] == 'host') {
179
        if ($a_hosts[$_GET['id']]) {
180
            unset($a_hosts[$_GET['id']]);
181
            write_config();
182
            mark_subsystem_dirty('unbound');
183
            header("Location: services_unbound.php");
184
            exit;
185
        }
186
    } elseif ($_GET['type'] == 'doverride') {
187
        if ($a_domainOverrides[$_GET['id']]) {
188
            unset($a_domainOverrides[$_GET['id']]);
189
            write_config();
190
            mark_subsystem_dirty('unbound');
191
            header("Location: services_unbound.php");
192
            exit;
193
        }
194
    }
178
	if ($_GET['type'] == 'host') {
179
		if ($a_hosts[$_GET['id']]) {
180
			unset($a_hosts[$_GET['id']]);
181
			write_config();
182
			mark_subsystem_dirty('unbound');
183
			header("Location: services_unbound.php");
184
			exit;
185
		}
186
	} elseif ($_GET['type'] == 'doverride') {
187
		if ($a_domainOverrides[$_GET['id']]) {
188
			unset($a_domainOverrides[$_GET['id']]);
189
			write_config();
190
			mark_subsystem_dirty('unbound');
191
			header("Location: services_unbound.php");
192
			exit;
193
		}
194
	}
195 195
}
196 196

  
197 197
$closehead = false;
......
201 201
?>
202 202

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

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

  
387 387

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

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

Also available in: Unified diff