Project

General

Profile

Download (19.5 KB) Statistics
| Branch: | Tag: | Revision:
1 04ad7c7c Scott Ullrich
<?php
2 62d01225 Bill Marquette
/* $Id$ */
3 5b237745 Scott Ullrich
/*
4
	system.php
5
	part of m0n0wall (http://m0n0.ch/wall)
6 04ad7c7c Scott Ullrich
7 5b237745 Scott Ullrich
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
8
	All rights reserved.
9 04ad7c7c Scott Ullrich
10 5b237745 Scott Ullrich
	Redistribution and use in source and binary forms, with or without
11
	modification, are permitted provided that the following conditions are met:
12 04ad7c7c Scott Ullrich
13 5b237745 Scott Ullrich
	1. Redistributions of source code must retain the above copyright notice,
14
	   this list of conditions and the following disclaimer.
15 04ad7c7c Scott Ullrich
16 5b237745 Scott Ullrich
	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 04ad7c7c Scott Ullrich
20 5b237745 Scott Ullrich
	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 1d333258 Scott Ullrich
/*
32
	pfSense_BUILDER_BINARIES:	/bin/kill	/usr/bin/tar
33
	pfSense_MODULE:	system
34
*/
35 5b237745 Scott Ullrich
36 6b07c15a Matthew Grooms
##|+PRIV
37
##|*IDENT=page-system-generalsetup
38
##|*NAME=System: General Setup page
39
##|*DESCR=Allow access to the 'System: General Setup' page.
40
##|*MATCH=system.php*
41
##|-PRIV
42
43 5b237745 Scott Ullrich
require("guiconfig.inc");
44 7a927e67 Scott Ullrich
require_once("functions.inc");
45
require_once("filter.inc");
46
require_once("shaper.inc");
47 5b237745 Scott Ullrich
48
$pconfig['hostname'] = $config['system']['hostname'];
49
$pconfig['domain'] = $config['system']['domain'];
50 93e0800d Scott Ullrich
list($pconfig['dns1'],$pconfig['dns2'],$pconfig['dns3'],$pconfig['dns4']) = $config['system']['dnsserver'];
51 0d8a219e Scott Ullrich
52 d623f2da Seth Mos
$arr_gateways = return_gateways_array();
53
54
$pconfig['dns1gw'] = $config['system']['dns1gw'];
55
$pconfig['dns2gw'] = $config['system']['dns2gw'];
56
$pconfig['dns3gw'] = $config['system']['dns3gw'];
57
$pconfig['dns4gw'] = $config['system']['dns4gw'];
58 e180a6e3 Scott Ullrich
59 5b237745 Scott Ullrich
$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
60
$pconfig['timezone'] = $config['system']['timezone'];
61
$pconfig['timeupdateinterval'] = $config['system']['time-update-interval'];
62
$pconfig['timeservers'] = $config['system']['timeservers'];
63 f0f7a3eb Scott Ullrich
$pconfig['theme'] = $config['system']['theme'];
64 3e139f90 Vinicius Coque
$pconfig['language'] = $config['system']['language'];
65 5b237745 Scott Ullrich
66 8ca95ed8 jim-p
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
67
68 5b237745 Scott Ullrich
if (!isset($pconfig['timeupdateinterval']))
69
	$pconfig['timeupdateinterval'] = 300;
70
if (!$pconfig['timezone'])
71
	$pconfig['timezone'] = "Etc/UTC";
72
if (!$pconfig['timeservers'])
73
	$pconfig['timeservers'] = "pool.ntp.org";
74 04ad7c7c Scott Ullrich
75 79eaddf4 Renato Botelho
$changedesc = gettext("System") . ": ";
76 62d01225 Bill Marquette
$changecount = 0;
77 417c6042 Bill Marquette
78 5b237745 Scott Ullrich
function is_timezone($elt) {
79
	return !preg_match("/\/$/", $elt);
80
}
81
82 aa1ab1da Scott Ullrich
if($pconfig['timezone'] <> $_POST['timezone']) {
83 744306c6 jim-p
	filter_pflog_start(true);
84 aa1ab1da Scott Ullrich
}
85
86 5b237745 Scott Ullrich
exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist);
87
$timezonelist = array_filter($timezonelist, 'is_timezone');
88
sort($timezonelist);
89
90 77446beb Matthew Grooms
$multiwan = false;
91 7922db8a Seth Mos
$interfaces = get_configured_interface_list();
92
foreach($interfaces as $interface) {
93
	if(interface_has_gateway($interface)) {
94 77446beb Matthew Grooms
		$multiwan = true;
95 7922db8a Seth Mos
	}
96
}
97 77446beb Matthew Grooms
98 5b237745 Scott Ullrich
if ($_POST) {
99
100 c668c964 Scott Ullrich
	$changecount++;
101 e180a6e3 Scott Ullrich
	
102 5b237745 Scott Ullrich
	unset($input_errors);
103
	$pconfig = $_POST;
104
105
	/* input validation */
106 cfbfd941 smos
	$reqdfields = explode(" ", "hostname domain");
107 38fb1109 Vinicius Coque
	$reqdfieldsn = array(gettext("Hostname"),gettext("Domain"));
108 04ad7c7c Scott Ullrich
109 1e9b4611 Renato Botelho
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
110 04ad7c7c Scott Ullrich
111 5b237745 Scott Ullrich
	if ($_POST['hostname'] && !is_hostname($_POST['hostname'])) {
112 7465d12c Carlos Eduardo Ramos
		$input_errors[] = gettext("The hostname may only contain the characters a-z, 0-9 and '-'.");
113 5b237745 Scott Ullrich
	}
114
	if ($_POST['domain'] && !is_domain($_POST['domain'])) {
115 7465d12c Carlos Eduardo Ramos
		$input_errors[] = gettext("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
116 5b237745 Scott Ullrich
	}
117 d623f2da Seth Mos
118 df4471e2 Phil Davis
	$ignore_posted_dnsgw = array();
119
120 d623f2da Seth Mos
	for ($dnscounter=1; $dnscounter<5; $dnscounter++){
121
		$dnsname="dns{$dnscounter}";
122
		$dnsgwname="dns{$dnscounter}gw";
123
		if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
124 52acb1ff Phil Davis
			$input_errors[] = gettext("A valid IP address must be specified for DNS server $dnscounter.");
125
		} else {
126
			if(($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
127
				// A real gateway has been selected.
128
				if (is_ipaddr($_POST[$dnsname])) {
129
					if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
130
						$input_errors[] = gettext("You can not specify IPv6 gateway '{$_POST[$dnsgwname]}' for IPv4 DNS server '{$_POST[$dnsname]}'");
131
					}
132
					if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
133
						$input_errors[] = gettext("You can not specify IPv4 gateway '{$_POST[$dnsgwname]}' for IPv6 DNS server '{$_POST[$dnsname]}'");
134
					}
135
				} else {
136 df4471e2 Phil Davis
					// The user selected a gateway but did not provide a DNS address. Be nice and set the gateway back to "none".
137
					$ignore_posted_dnsgw[$dnsgwname] = true;
138 52acb1ff Phil Davis
				}
139 13ea7caa smos
			}
140 d623f2da Seth Mos
		}
141 5b237745 Scott Ullrich
	}
142 d623f2da Seth Mos
143 985fc0fb Ermal Lu?i
	$direct_networks_list = explode(" ", filter_get_direct_networks_list());
144 c98d28e1 Seth Mos
	for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
145
		$dnsitem = "dns{$dnscounter}";
146 d623f2da Seth Mos
		$dnsgwitem = "dns{$dnscounter}gw";
147 c98d28e1 Seth Mos
		if ($_POST[$dnsgwitem]) {
148
			if(interface_has_gateway($_POST[$dnsgwitem])) {
149
				foreach($direct_networks_list as $direct_network) {
150
					if(ip_in_subnet($_POST[$dnsitem], $direct_network)) {
151 d1d0a1ad Vinicius Coque
						$input_errors[] = sprintf(gettext("You can not assign a gateway to DNS '%s' server which is on a directly connected network."),$_POST[$dnsitem]);
152 c98d28e1 Seth Mos
					}
153
				}
154
			}
155
		}
156
	}
157
158 5b237745 Scott Ullrich
	$t = (int)$_POST['timeupdateinterval'];
159
	if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
160 7465d12c Carlos Eduardo Ramos
		$input_errors[] = gettext("The time update interval must be either 0 (disabled) or between 6 and 1440.");
161 5b237745 Scott Ullrich
	}
162 8adb814b David P Hilton
	# it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
163
	$_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
164
	$_POST['timeservers'] = trim($_POST['timeservers']);
165 5b237745 Scott Ullrich
	foreach (explode(' ', $_POST['timeservers']) as $ts) {
166
		if (!is_domain($ts)) {
167 7465d12c Carlos Eduardo Ramos
			$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
168 5b237745 Scott Ullrich
		}
169
	}
170
171
	if (!$input_errors) {
172 f1a34790 N0YB
		update_if_changed("hostname", $config['system']['hostname'], $_POST['hostname']);
173
		update_if_changed("domain", $config['system']['domain'], $_POST['domain']);
174 79f8694f Bill Marquette
175 9eab73da Bill Marquette
		update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
176
		update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
177
		update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
178 04ad7c7c Scott Ullrich
179 3e139f90 Vinicius Coque
		if($_POST['language'] && $_POST['language'] != $config['system']['language']) {
180
			$config['system']['language'] = $_POST['language'];
181
			set_language($config['system']['language']);
182
		}
183
184 f0f7a3eb Scott Ullrich
		/* pfSense themes */
185 7321c93c Chris Buechler
		if (! $g['disablethemeselection']) {
186
			update_if_changed("System Theme", $config['theme'], $_POST['theme']);	
187
		}
188 f0f7a3eb Scott Ullrich
189 4fbf63aa Bill Marquette
		/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
190 52acb1ff Phil Davis
		$olddnsservers = $config['system']['dnsserver'];
191 5b237745 Scott Ullrich
		unset($config['system']['dnsserver']);
192
		if ($_POST['dns1'])
193
			$config['system']['dnsserver'][] = $_POST['dns1'];
194
		if ($_POST['dns2'])
195
			$config['system']['dnsserver'][] = $_POST['dns2'];
196 93e0800d Scott Ullrich
		if ($_POST['dns3'])
197
			$config['system']['dnsserver'][] = $_POST['dns3'];
198
		if ($_POST['dns4'])
199
			$config['system']['dnsserver'][] = $_POST['dns4'];
200 04ad7c7c Scott Ullrich
201 07bd3f83 Scott Ullrich
		$olddnsallowoverride = $config['system']['dnsallowoverride'];
202 20b90e0a Scott Ullrich
203 0d8a219e Scott Ullrich
		unset($config['system']['dnsallowoverride']);
204 5b237745 Scott Ullrich
		$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
205 e180a6e3 Scott Ullrich
206 8ca95ed8 jim-p
		if($_POST['dnslocalhost'] == "yes")
207
			$config['system']['dnslocalhost'] = true;
208
		else
209
			unset($config['system']['dnslocalhost']);
210
211 e180a6e3 Scott Ullrich
		/* which interface should the dns servers resolve through? */
212 df4471e2 Phil Davis
		$outdnscounter = 0;
213 d623f2da Seth Mos
		for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
214
			$dnsname="dns{$dnscounter}";
215
			$dnsgwname="dns{$dnscounter}gw";
216 52acb1ff Phil Davis
			$olddnsgwname = $config['system'][$dnsgwname];
217 df4471e2 Phil Davis
218
			if ($ignore_posted_dnsgw[$dnsgwname])
219
				$thisdnsgwname = "none";
220
			else
221
				$thisdnsgwname = $pconfig[$dnsgwname];
222
223
			// "Blank" out the settings for this index, then we set them below using the "outdnscounter" index.
224
			$config['system'][$dnsgwname] = "none";
225
			$pconfig[$dnsgwname] = "none";
226
			$pconfig[$dnsname] = "";
227
228
			if ($_POST[$dnsname]) {
229
				// Only the non-blank DNS servers were put into the config above.
230
				// So we similarly only add the corresponding gateways sequentially to the config (and to pconfig), as we find non-blank DNS servers.
231
				// This keeps the DNS server IP and corresponding gateway "lined up" when the user blanks out a DNS server IP in the middle of the list.
232
				$outdnscounter++;
233
				$outdnsname="dns{$outdnscounter}";
234
				$outdnsgwname="dns{$outdnscounter}gw";
235
				$pconfig[$outdnsname] = $_POST[$dnsname];
236
				if($_POST[$dnsgwname]) {
237
					$config['system'][$outdnsgwname] = $thisdnsgwname;
238
					$pconfig[$outdnsgwname] = $thisdnsgwname;
239
				} else {
240
					// Note: when no DNS GW name is chosen, the entry is set to "none", so actually this case never happens.
241
					unset($config['system'][$outdnsgwname]);
242
					$pconfig[$outdnsgwname] = "";
243
				}
244 d623f2da Seth Mos
			}
245 df4471e2 Phil Davis
			if (($olddnsgwname != "") && ($olddnsgwname != "none") && (($olddnsgwname != $thisdnsgwname) || ($olddnsservers[$dnscounter-1] != $_POST[$dnsname]))) {
246 52acb1ff Phil Davis
				// A previous DNS GW name was specified. It has now gone or changed, or the DNS server address has changed.
247
				// Remove the route. Later calls will add the correct new route if needed.
248
				if (is_ipaddrv4($olddnsservers[$dnscounter-1]))
249
					mwexec("/sbin/route delete " . escapeshellarg($olddnsservers[$dnscounter-1]));
250
				else
251
					if (is_ipaddrv6($olddnsservers[$dnscounter-1]))
252
						mwexec("/sbin/route delete -inet6 " . escapeshellarg($olddnsservers[$dnscounter-1]));
253
			}
254 d623f2da Seth Mos
		}
255 04ad7c7c Scott Ullrich
256 62d01225 Bill Marquette
		if ($changecount > 0)
257
			write_config($changedesc);
258 04ad7c7c Scott Ullrich
259 5b237745 Scott Ullrich
		$retval = 0;
260 3cfdba5f Scott Ullrich
		$retval = system_hostname_configure();
261
		$retval |= system_hosts_generate();
262
		$retval |= system_resolvconf_generate();
263 1e2c8821 Warren Baker
		if (isset($config['dnsmasq']['enable']))
264
			$retval |= services_dnsmasq_configure();
265
		elseif (isset($config['unbound']['enable']))
266
			$retval |= services_unbound_configure();
267 3cfdba5f Scott Ullrich
		$retval |= system_timezone_configure();
268
		$retval |= system_ntp_configure();
269
270
		if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
271 b8292903 Ermal
			$retval |= send_event("service reload dns");
272 3cfdba5f Scott Ullrich
273 e7d967d8 Scott Ullrich
		// Reload the filter - plugins might need to be run.
274 0027de0a Ermal Lu?i
		$retval |= filter_configure();
275 e7d967d8 Scott Ullrich
		
276 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
277
	}
278 df4471e2 Phil Davis
279
	unset($ignore_posted_dnsgw);
280 5b237745 Scott Ullrich
}
281 4df96eff Scott Ullrich
282 7465d12c Carlos Eduardo Ramos
$pgtitle = array(gettext("System"),gettext("General Setup"));
283 4df96eff Scott Ullrich
include("head.inc");
284
285 5b237745 Scott Ullrich
?>
286 4df96eff Scott Ullrich
287 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
288 f0f7a3eb Scott Ullrich
<?php
289 77446beb Matthew Grooms
	include("fbegin.inc");
290
	if ($input_errors)
291
		print_input_errors($input_errors);
292
	if ($savemsg)
293
		print_info_box($savemsg);
294 f0f7a3eb Scott Ullrich
?>
295 77446beb Matthew Grooms
	<form action="system.php" method="post">
296 925020e7 Colin Fleming
		<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general setup">
297 27b07eda Ermal Lu?i
                        <tr>
298
                                <td id="mainarea">
299
                                        <div class="tabcont">
300 925020e7 Colin Fleming
			<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
301 77446beb Matthew Grooms
			<tr>
302 7465d12c Carlos Eduardo Ramos
				<td colspan="2" valign="top" class="listtopic"><?=gettext("System"); ?></td>
303 77446beb Matthew Grooms
			</tr>
304
			<tr>
305 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
306 925020e7 Colin Fleming
				<td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld unknown" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
307 8cd558b6 ayvis
					<br />
308 77446beb Matthew Grooms
					<span class="vexpl">
309 22a11a58 Larry Gilbert
						<?=gettext("Name of the firewall host, without domain part"); ?>
310 8cd558b6 ayvis
						<br />
311 7465d12c Carlos Eduardo Ramos
						<?=gettext("e.g."); ?> <em>firewall</em>
312 77446beb Matthew Grooms
					</span>
313
				</td>
314
			</tr>
315
			<tr>
316 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain"); ?></td>
317 925020e7 Colin Fleming
				<td width="78%" class="vtable"> <input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
318 8cd558b6 ayvis
					<br />
319 77446beb Matthew Grooms
					<span class="vexpl">
320 7465d12c Carlos Eduardo Ramos
						<?=gettext("Do not use 'local' as a domain name. It will cause local hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve local hosts not running mDNS."); ?>
321 8cd558b6 ayvis
						<br />
322 7465d12c Carlos Eduardo Ramos
						<?=gettext("e.g."); ?> <em><?=gettext("mycorp.com, home, office, private, etc."); ?></em>
323 77446beb Matthew Grooms
					</span>
324
				</td>
325
			</tr>
326
			<tr>
327 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
328 77446beb Matthew Grooms
				<td width="78%" class="vtable">
329 8cd558b6 ayvis
						<br />
330 925020e7 Colin Fleming
						<table summary="dns servers and gateways">
331 77446beb Matthew Grooms
							<tr>
332 7465d12c Carlos Eduardo Ramos
								<td><b><?=gettext("DNS Server"); ?></b></td>
333 77446beb Matthew Grooms
								<?php if ($multiwan): ?>
334 7465d12c Carlos Eduardo Ramos
								<td><b><?=gettext("Use gateway"); ?></b></td>
335 77446beb Matthew Grooms
								<?php endif; ?>
336
							</tr>
337
							<?php
338
								for ($dnscounter=1; $dnscounter<5; $dnscounter++):
339 d623f2da Seth Mos
									$fldname="dns{$dnscounter}gw";
340 77446beb Matthew Grooms
							?>
341
							<tr>
342
								<td>
343 925020e7 Colin Fleming
									<input name="dns<?php echo $dnscounter;?>" type="text" class="formfld unknown" id="dns<?php echo $dnscounter;?>" size="28" value="<?php echo $pconfig['dns'.$dnscounter];?>" />
344 77446beb Matthew Grooms
								</td>
345
								<td>
346 a077b479 Ermal Luçi
<?php if ($multiwan): ?>
347 3537ac27 Seth Mos
									<select name='<?=$fldname;?>'>
348 77446beb Matthew Grooms
										<?php
349 d623f2da Seth Mos
											$gwname = "none";
350
											$dnsgw = "dns{$dnscounter}gw";
351
											if($pconfig[$dnsgw] == $gwname) {
352 925020e7 Colin Fleming
												$selected = "selected=\"selected\"";
353 7922db8a Seth Mos
											} else {
354 77446beb Matthew Grooms
												$selected = "";
355 7922db8a Seth Mos
											}
356 d623f2da Seth Mos
											echo "<option value='$gwname' $selected>$gwname</option>\n";
357
											foreach($arr_gateways as $gwname => $gwitem) {
358 925020e7 Colin Fleming
												//echo $pconfig[$dnsgw];
359 d623f2da Seth Mos
												if((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
360
													continue;
361
												}
362
												if((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
363
													continue;
364
												}
365
												if($pconfig[$dnsgw] == $gwname) {
366 925020e7 Colin Fleming
													$selected = "selected=\"selected\"";
367 d623f2da Seth Mos
												} else {
368
													$selected = "";
369 7922db8a Seth Mos
												}
370 925020e7 Colin Fleming
												echo "<option value='$gwname' $selected>$gwname - {$gwitem['friendlyiface']} - {$gwitem['gateway']}</option>\n";
371 7922db8a Seth Mos
											}
372 77446beb Matthew Grooms
										?>
373
									</select>
374 a077b479 Ermal Luçi
<?php endif; ?>
375 77446beb Matthew Grooms
								</td>
376
							</tr>
377
							<?php endfor; ?>
378
						</table>
379 925020e7 Colin Fleming
						<br />
380 77446beb Matthew Grooms
						<span class="vexpl">
381 3efa7976 Warren Baker
							<?=gettext("Enter IP addresses to be used by the system for DNS resolution. " .
382 c61ed3db jim-p
							"These are also used for the DHCP service, DNS forwarder and for PPTP VPN clients."); ?>
383 8cd558b6 ayvis
							<br />
384 77446beb Matthew Grooms
							<?php if($multiwan): ?>
385 8cd558b6 ayvis
							<br />
386 c61ed3db jim-p
							<?=gettext("In addition, optionally select the gateway for each DNS server. " .
387
							"When using multiple WAN connections there should be at least one unique DNS server per gateway."); ?>
388 8cd558b6 ayvis
							<br />
389 77446beb Matthew Grooms
							<?php endif; ?>
390 8cd558b6 ayvis
							<br />
391 925020e7 Colin Fleming
							<input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked=\"checked\""; ?> />
392 77446beb Matthew Grooms
							<strong>
393 ad5b5f61 Renato Botelho
								<?=gettext("Allow DNS server list to be overridden by DHCP/PPP on WAN"); ?>
394 77446beb Matthew Grooms
							</strong>
395 8cd558b6 ayvis
							<br />
396 ea6be4a7 Erik Fonnesbeck
							<?php printf(gettext("If this option is set, %s will " .
397 f49a012c Renato Botelho
							"use DNS servers assigned by a DHCP/PPP server on WAN " .
398
							"for its own purposes (including the DNS forwarder). " .
399
							"However, they will not be assigned to DHCP and PPTP " .
400
							"VPN clients."), $g['product_name']); ?>
401 8ca95ed8 jim-p
							<br />
402
							<br />
403 925020e7 Colin Fleming
							<input name="dnslocalhost" type="checkbox" id="dnslocalhost" value="yes" <?php if ($pconfig['dnslocalhost']) echo "checked=\"checked\""; ?> />
404 8ca95ed8 jim-p
							<strong>
405
								<?=gettext("Do not use the DNS Forwarder as a DNS server for the firewall"); ?>
406
							</strong>
407
							<br />
408 bd5737dc jim-p
							<?=gettext("By default localhost (127.0.0.1) will be used as the first DNS server where the DNS Forwarder or DNS Resolver is enabled and set to listen on Localhost, so system can use the local DNS service to perform lookups. ".
409 8ca95ed8 jim-p
							"Checking this box omits localhost from the list of DNS servers."); ?>
410 77446beb Matthew Grooms
						</span>
411
				</td>
412
			</tr>
413
			<tr>
414 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("Time zone"); ?></td>
415 77446beb Matthew Grooms
				<td width="78%" class="vtable">
416
					<select name="timezone" id="timezone">
417
						<?php foreach ($timezonelist as $value): ?>
418 5c1f3ed2 sullrich
						<?php if(strstr($value, "GMT")) continue; ?>
419 925020e7 Colin Fleming
						<option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected=\"selected\""; ?>>
420 77446beb Matthew Grooms
							<?=htmlspecialchars($value);?>
421
						</option>
422
						<?php endforeach; ?>
423 f0f7a3eb Scott Ullrich
					</select>
424 8cd558b6 ayvis
					<br />
425 77446beb Matthew Grooms
					<span class="vexpl">
426 7465d12c Carlos Eduardo Ramos
						<?=gettext("Select the location closest to you"); ?>
427 77446beb Matthew Grooms
					</span>
428
				</td>
429
			</tr>
430
<!--
431
			<tr>
432
				<td width="22%" valign="top" class="vncell">Time update interval</td>
433
				<td width="78%" class="vtable">
434 925020e7 Colin Fleming
					<input name="timeupdateinterval" type="text" class="formfld unknown" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>" />
435 8cd558b6 ayvis
					<br />
436 77446beb Matthew Grooms
					<span class="vexpl">
437
						Minutes between network time sync. 300 recommended,
438
						or 0 to disable
439
					</span>
440
				</td>
441
			</tr>
442
-->
443
			<tr>
444 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("NTP time server"); ?></td>
445 77446beb Matthew Grooms
				<td width="78%" class="vtable">
446 925020e7 Colin Fleming
					<input name="timeservers" type="text" class="formfld unknown" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>" />
447 8cd558b6 ayvis
					<br />
448 77446beb Matthew Grooms
					<span class="vexpl">
449 f0d1af93 Carlos Eduardo Ramos
						<?=gettext("Use a space to separate multiple hosts (only one " .
450
						"required). Remember to set up at least one DNS server " .
451
						"if you enter a host name here!"); ?>
452 77446beb Matthew Grooms
					</span>
453
				</td>
454
			</tr>
455 3e139f90 Vinicius Coque
			<tr>
456
				<td width="22%" valign="top" class="vncell"><?php echo gettext("Language");?></td>
457
				<td width="78%" class="vtable">
458
					<select name="language">
459
						<?php
460
						foreach(get_locale_list() as $lcode => $ldesc) {
461 925020e7 Colin Fleming
							$selected = ' selected="selected"';
462 3e139f90 Vinicius Coque
							if($lcode != $pconfig['language'])
463
								$selected = '';
464
							echo "<option value=\"{$lcode}\"{$selected}>{$ldesc}</option>";
465
						}
466
						?>
467
					</select>
468
					<strong>
469
						<?=gettext("Choose a language for the webConfigurator"); ?>
470
					</strong>
471
				</td>
472
			</tr>
473 77446beb Matthew Grooms
			<tr>
474
				<td colspan="2" class="list" height="12">&nbsp;</td>
475
			</tr>
476 8b289232 Chris Buechler
			<?php if (! $g['disablethemeselection']): ?>
477 77446beb Matthew Grooms
			<tr>
478 7465d12c Carlos Eduardo Ramos
				<td colspan="2" valign="top" class="listtopic"><?=gettext("Theme"); ?></td>
479 77446beb Matthew Grooms
			</tr>
480
			<tr>
481
				<td width="22%" valign="top" class="vncell">&nbsp;</td>
482
				<td width="78%" class="vtable">
483
					<select name="theme">
484
						<?php
485
							$files = return_dir_as_array("/usr/local/www/themes/");
486
							foreach($files as $f):
487
								if ((substr($f, 0, 1) == "_") && !isset($config['system']['developer']))
488
									continue;
489
								if ($f == "CVS")
490
									continue;
491
								$curtheme = "pfsense";
492
								if ($config['theme'])
493
									$curtheme = $config['theme'];
494
								$selected = "";
495
								if($f == $curtheme)
496 925020e7 Colin Fleming
									$selected = " selected=\"selected\"";
497 77446beb Matthew Grooms
						?>
498
						<option <?=$selected;?>><?=$f;?></option>
499
						<?php endforeach; ?>
500
					</select>
501
					<strong>
502 7465d12c Carlos Eduardo Ramos
						<?=gettext("This will change the look and feel of"); ?>
503 77446beb Matthew Grooms
						<?=$g['product_name'];?>.
504
					</strong>
505
				</td>
506
			</tr>
507 8b289232 Chris Buechler
			<?php endif; ?>
508 306f082a Scott Ullrich
			<tr>
509
				<td colspan="2" class="list" height="12">&nbsp;</td>
510
			</tr>			
511 77446beb Matthew Grooms
			<tr>
512
				<td width="22%" valign="top">&nbsp;</td>
513
				<td width="78%">
514 925020e7 Colin Fleming
					<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
515 f0f7a3eb Scott Ullrich
				</td>
516 77446beb Matthew Grooms
			</tr>
517
		</table>
518 27b07eda Ermal Lu?i
		</div>
519
		</td></tr>
520
		</table>
521 77446beb Matthew Grooms
	</form>
522 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
523 2f3f316c Scott Ullrich
</body>
524
</html>