Project

General

Profile

Download (17.3 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 5b237745 Scott Ullrich
	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
	for ($dnscounter=1; $dnscounter<5; $dnscounter++){
119
		$dnsname="dns{$dnscounter}";
120
		$dnsgwname="dns{$dnscounter}gw";
121
		if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
122
			$input_errors[] = gettext("A valid IP address must be specified for the DNS server $dnscounter.");
123
		}
124 13ea7caa smos
		if(($_POST[$dnsgwname] <> "") && (is_ipaddr($_POST[$dnsname]))) {
125
			if (($_POST[$dnsgwname] <> "none") && (is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
126
				$input_errors[] = gettext("You can not specify a IPv6 gateway '{$_POST[$dnsgwname]}'for a IPv4 DNS server '{$_POST[$dnsname]}'");
127
			}
128
			if (($_POST[$dnsgwname] <> "none") && (is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false )) {
129
				$input_errors[] = gettext("You can not specify a IPv4 gateway '{$_POST[$dnsgwname]}'for a IPv6 DNS server '{$_POST[$dnsname]}'");
130
			}
131 d623f2da Seth Mos
		}
132 5b237745 Scott Ullrich
	}
133 d623f2da Seth Mos
134 04ad7c7c Scott Ullrich
	if ($_POST['webguiport'] && (!is_numericint($_POST['webguiport']) ||
135 5b237745 Scott Ullrich
			($_POST['webguiport'] < 1) || ($_POST['webguiport'] > 65535))) {
136 7465d12c Carlos Eduardo Ramos
		$input_errors[] = gettext("A valid TCP/IP port must be specified for the webConfigurator port.");
137 5b237745 Scott Ullrich
	}
138 04ad7c7c Scott Ullrich
139 985fc0fb Ermal Lu?i
	$direct_networks_list = explode(" ", filter_get_direct_networks_list());
140 c98d28e1 Seth Mos
	for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
141
		$dnsitem = "dns{$dnscounter}";
142 d623f2da Seth Mos
		$dnsgwitem = "dns{$dnscounter}gw";
143 c98d28e1 Seth Mos
		if ($_POST[$dnsgwitem]) {
144
			if(interface_has_gateway($_POST[$dnsgwitem])) {
145
				foreach($direct_networks_list as $direct_network) {
146
					if(ip_in_subnet($_POST[$dnsitem], $direct_network)) {
147 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]);
148 c98d28e1 Seth Mos
					}
149
				}
150
			}
151
		}
152
	}
153
154 5b237745 Scott Ullrich
	$t = (int)$_POST['timeupdateinterval'];
155
	if (($t < 0) || (($t > 0) && ($t < 6)) || ($t > 1440)) {
156 7465d12c Carlos Eduardo Ramos
		$input_errors[] = gettext("The time update interval must be either 0 (disabled) or between 6 and 1440.");
157 5b237745 Scott Ullrich
	}
158
	foreach (explode(' ', $_POST['timeservers']) as $ts) {
159
		if (!is_domain($ts)) {
160 7465d12c Carlos Eduardo Ramos
			$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
161 5b237745 Scott Ullrich
		}
162
	}
163
164
	if (!$input_errors) {
165 9eab73da Bill Marquette
		update_if_changed("hostname", $config['system']['hostname'], strtolower($_POST['hostname']));
166
		update_if_changed("domain", $config['system']['domain'], strtolower($_POST['domain']));
167 79f8694f Bill Marquette
168 9eab73da Bill Marquette
		update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
169
		update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
170
		update_if_changed("NTP update interval", $config['system']['time-update-interval'], $_POST['timeupdateinterval']);
171 04ad7c7c Scott Ullrich
172 3e139f90 Vinicius Coque
		if($_POST['language'] && $_POST['language'] != $config['system']['language']) {
173
			$config['system']['language'] = $_POST['language'];
174
			set_language($config['system']['language']);
175
		}
176
177 f0f7a3eb Scott Ullrich
		/* pfSense themes */
178 7321c93c Chris Buechler
		if (! $g['disablethemeselection']) {
179
			update_if_changed("System Theme", $config['theme'], $_POST['theme']);	
180
		}
181 f0f7a3eb Scott Ullrich
182 4fbf63aa Bill Marquette
		/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
183 5b237745 Scott Ullrich
		unset($config['system']['dnsserver']);
184
		if ($_POST['dns1'])
185
			$config['system']['dnsserver'][] = $_POST['dns1'];
186
		if ($_POST['dns2'])
187
			$config['system']['dnsserver'][] = $_POST['dns2'];
188 93e0800d Scott Ullrich
		if ($_POST['dns3'])
189
			$config['system']['dnsserver'][] = $_POST['dns3'];
190
		if ($_POST['dns4'])
191
			$config['system']['dnsserver'][] = $_POST['dns4'];
192 04ad7c7c Scott Ullrich
193 07bd3f83 Scott Ullrich
		$olddnsallowoverride = $config['system']['dnsallowoverride'];
194 20b90e0a Scott Ullrich
195 0d8a219e Scott Ullrich
		unset($config['system']['dnsallowoverride']);
196 5b237745 Scott Ullrich
		$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
197 e180a6e3 Scott Ullrich
198 8ca95ed8 jim-p
		if($_POST['dnslocalhost'] == "yes")
199
			$config['system']['dnslocalhost'] = true;
200
		else
201
			unset($config['system']['dnslocalhost']);
202
203 e180a6e3 Scott Ullrich
		/* which interface should the dns servers resolve through? */
204 d623f2da Seth Mos
		for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
205
			$dnsname="dns{$dnscounter}";
206
			$dnsgwname="dns{$dnscounter}gw";
207
			if($_POST[$dnsgwname]) {
208
				$config['system'][$dnsgwname] = $pconfig[$dnsgwname];
209
			} else {
210
				unset($config['system'][$dnsgwname]);
211
			}
212
		}
213 04ad7c7c Scott Ullrich
214 62d01225 Bill Marquette
		if ($changecount > 0)
215
			write_config($changedesc);
216 04ad7c7c Scott Ullrich
217 5b237745 Scott Ullrich
		$retval = 0;
218 3cfdba5f Scott Ullrich
		$retval = system_hostname_configure();
219
		$retval |= system_hosts_generate();
220
		$retval |= system_resolvconf_generate();
221
		$retval |= services_dnsmasq_configure();
222
		$retval |= system_timezone_configure();
223
		$retval |= system_ntp_configure();
224
225
		if ($olddnsallowoverride != $config['system']['dnsallowoverride'])
226 b8292903 Ermal
			$retval |= send_event("service reload dns");
227 3cfdba5f Scott Ullrich
228 e7d967d8 Scott Ullrich
		// Reload the filter - plugins might need to be run.
229 0027de0a Ermal Lu?i
		$retval |= filter_configure();
230 e7d967d8 Scott Ullrich
		
231 5b237745 Scott Ullrich
		$savemsg = get_std_save_message($retval);
232
	}
233
}
234 4df96eff Scott Ullrich
235 7465d12c Carlos Eduardo Ramos
$pgtitle = array(gettext("System"),gettext("General Setup"));
236 4df96eff Scott Ullrich
include("head.inc");
237
238 5b237745 Scott Ullrich
?>
239 4df96eff Scott Ullrich
240 5b237745 Scott Ullrich
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
241 f0f7a3eb Scott Ullrich
<?php
242 77446beb Matthew Grooms
	include("fbegin.inc");
243
	if ($input_errors)
244
		print_input_errors($input_errors);
245
	if ($savemsg)
246
		print_info_box($savemsg);
247 f0f7a3eb Scott Ullrich
?>
248 77446beb Matthew Grooms
	<form action="system.php" method="post">
249 925020e7 Colin Fleming
		<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="general setup">
250 27b07eda Ermal Lu?i
                        <tr>
251
                                <td id="mainarea">
252
                                        <div class="tabcont">
253 925020e7 Colin Fleming
			<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
254 77446beb Matthew Grooms
			<tr>
255 7465d12c Carlos Eduardo Ramos
				<td colspan="2" valign="top" class="listtopic"><?=gettext("System"); ?></td>
256 77446beb Matthew Grooms
			</tr>
257
			<tr>
258 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncellreq"><?=gettext("Hostname"); ?></td>
259 925020e7 Colin Fleming
				<td width="78%" class="vtable"> <input name="hostname" type="text" class="formfld unknown" id="hostname" size="40" value="<?=htmlspecialchars($pconfig['hostname']);?>" />
260 77446beb Matthew Grooms
					<br/>
261
					<span class="vexpl">
262 22a11a58 Larry Gilbert
						<?=gettext("Name of the firewall host, without domain part"); ?>
263 10e41b74 gnhb
						<br/>
264 7465d12c Carlos Eduardo Ramos
						<?=gettext("e.g."); ?> <em>firewall</em>
265 77446beb Matthew Grooms
					</span>
266
				</td>
267
			</tr>
268
			<tr>
269 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncellreq"><?=gettext("Domain"); ?></td>
270 925020e7 Colin Fleming
				<td width="78%" class="vtable"> <input name="domain" type="text" class="formfld unknown" id="domain" size="40" value="<?=htmlspecialchars($pconfig['domain']);?>" />
271 77446beb Matthew Grooms
					<br/>
272
					<span class="vexpl">
273 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."); ?>
274 10e41b74 gnhb
						<br/>
275 7465d12c Carlos Eduardo Ramos
						<?=gettext("e.g."); ?> <em><?=gettext("mycorp.com, home, office, private, etc."); ?></em>
276 77446beb Matthew Grooms
					</span>
277
				</td>
278
			</tr>
279
			<tr>
280 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("DNS servers"); ?></td>
281 77446beb Matthew Grooms
				<td width="78%" class="vtable">
282 925020e7 Colin Fleming
						<br/>
283
						<table summary="dns servers and gateways">
284 77446beb Matthew Grooms
							<tr>
285 7465d12c Carlos Eduardo Ramos
								<td><b><?=gettext("DNS Server"); ?></b></td>
286 77446beb Matthew Grooms
								<?php if ($multiwan): ?>
287 7465d12c Carlos Eduardo Ramos
								<td><b><?=gettext("Use gateway"); ?></b></td>
288 77446beb Matthew Grooms
								<?php endif; ?>
289
							</tr>
290
							<?php
291
								for ($dnscounter=1; $dnscounter<5; $dnscounter++):
292 d623f2da Seth Mos
									$fldname="dns{$dnscounter}gw";
293 77446beb Matthew Grooms
							?>
294
							<tr>
295
								<td>
296 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];?>" />
297 77446beb Matthew Grooms
								</td>
298
								<td>
299 a077b479 Ermal Luçi
<?php if ($multiwan): ?>
300 3537ac27 Seth Mos
									<select name='<?=$fldname;?>'>
301 77446beb Matthew Grooms
										<?php
302 d623f2da Seth Mos
											$gwname = "none";
303
											$dnsgw = "dns{$dnscounter}gw";
304
											if($pconfig[$dnsgw] == $gwname) {
305 925020e7 Colin Fleming
												$selected = "selected=\"selected\"";
306 7922db8a Seth Mos
											} else {
307 77446beb Matthew Grooms
												$selected = "";
308 7922db8a Seth Mos
											}
309 d623f2da Seth Mos
											echo "<option value='$gwname' $selected>$gwname</option>\n";
310
											foreach($arr_gateways as $gwname => $gwitem) {
311 925020e7 Colin Fleming
												//echo $pconfig[$dnsgw];
312 d623f2da Seth Mos
												if((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
313
													continue;
314
												}
315
												if((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
316
													continue;
317
												}
318
												if($pconfig[$dnsgw] == $gwname) {
319 925020e7 Colin Fleming
													$selected = "selected=\"selected\"";
320 d623f2da Seth Mos
												} else {
321
													$selected = "";
322 7922db8a Seth Mos
												}
323 925020e7 Colin Fleming
												echo "<option value='$gwname' $selected>$gwname - {$gwitem['friendlyiface']} - {$gwitem['gateway']}</option>\n";
324 7922db8a Seth Mos
											}
325 77446beb Matthew Grooms
										?>
326
									</select>
327 a077b479 Ermal Luçi
<?php endif; ?>
328 77446beb Matthew Grooms
								</td>
329
							</tr>
330
							<?php endfor; ?>
331
						</table>
332 925020e7 Colin Fleming
						<br />
333 77446beb Matthew Grooms
						<span class="vexpl">
334 c61ed3db jim-p
							<?=gettext("Enter IP addresses to by used by the system for DNS resolution." .
335
							"These are also used for the DHCP service, DNS forwarder and for PPTP VPN clients."); ?>
336 77446beb Matthew Grooms
							<br/>
337
							<?php if($multiwan): ?>
338
							<br/>
339 c61ed3db jim-p
							<?=gettext("In addition, optionally select the gateway for each DNS server. " .
340
							"When using multiple WAN connections there should be at least one unique DNS server per gateway."); ?>
341 77446beb Matthew Grooms
							<br/>
342
							<?php endif; ?>
343
							<br/>
344 925020e7 Colin Fleming
							<input name="dnsallowoverride" type="checkbox" id="dnsallowoverride" value="yes" <?php if ($pconfig['dnsallowoverride']) echo "checked=\"checked\""; ?> />
345 77446beb Matthew Grooms
							<strong>
346 ad5b5f61 Renato Botelho
								<?=gettext("Allow DNS server list to be overridden by DHCP/PPP on WAN"); ?>
347 77446beb Matthew Grooms
							</strong>
348
							<br/>
349 ea6be4a7 Erik Fonnesbeck
							<?php printf(gettext("If this option is set, %s will " .
350 f49a012c Renato Botelho
							"use DNS servers assigned by a DHCP/PPP server on WAN " .
351
							"for its own purposes (including the DNS forwarder). " .
352
							"However, they will not be assigned to DHCP and PPTP " .
353
							"VPN clients."), $g['product_name']); ?>
354 8ca95ed8 jim-p
							<br />
355
							<br />
356 925020e7 Colin Fleming
							<input name="dnslocalhost" type="checkbox" id="dnslocalhost" value="yes" <?php if ($pconfig['dnslocalhost']) echo "checked=\"checked\""; ?> />
357 8ca95ed8 jim-p
							<strong>
358
								<?=gettext("Do not use the DNS Forwarder as a DNS server for the firewall"); ?>
359
							</strong>
360
							<br />
361
							<?=gettext("By default localhost (127.0.0.1) will be used as the first DNS server where the DNS forwarder is enabled, so system can use the DNS forwarder to perform lookups. ".
362
							"Checking this box omits localhost from the list of DNS servers."); ?>
363 77446beb Matthew Grooms
						</span>
364
				</td>
365
			</tr>
366
			<tr>
367 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("Time zone"); ?></td>
368 77446beb Matthew Grooms
				<td width="78%" class="vtable">
369
					<select name="timezone" id="timezone">
370
						<?php foreach ($timezonelist as $value): ?>
371 5c1f3ed2 sullrich
						<?php if(strstr($value, "GMT")) continue; ?>
372 925020e7 Colin Fleming
						<option value="<?=htmlspecialchars($value);?>" <?php if ($value == $pconfig['timezone']) echo "selected=\"selected\""; ?>>
373 77446beb Matthew Grooms
							<?=htmlspecialchars($value);?>
374
						</option>
375
						<?php endforeach; ?>
376 f0f7a3eb Scott Ullrich
					</select>
377 77446beb Matthew Grooms
					<br/>
378
					<span class="vexpl">
379 7465d12c Carlos Eduardo Ramos
						<?=gettext("Select the location closest to you"); ?>
380 77446beb Matthew Grooms
					</span>
381
				</td>
382
			</tr>
383
<!--
384
			<tr>
385
				<td width="22%" valign="top" class="vncell">Time update interval</td>
386
				<td width="78%" class="vtable">
387 925020e7 Colin Fleming
					<input name="timeupdateinterval" type="text" class="formfld unknown" id="timeupdateinterval" size="4" value="<?=htmlspecialchars($pconfig['timeupdateinterval']);?>" />
388 77446beb Matthew Grooms
					<br/>
389
					<span class="vexpl">
390
						Minutes between network time sync. 300 recommended,
391
						or 0 to disable
392
					</span>
393
				</td>
394
			</tr>
395
-->
396
			<tr>
397 7465d12c Carlos Eduardo Ramos
				<td width="22%" valign="top" class="vncell"><?=gettext("NTP time server"); ?></td>
398 77446beb Matthew Grooms
				<td width="78%" class="vtable">
399 925020e7 Colin Fleming
					<input name="timeservers" type="text" class="formfld unknown" id="timeservers" size="40" value="<?=htmlspecialchars($pconfig['timeservers']);?>" />
400 77446beb Matthew Grooms
					<br/>
401
					<span class="vexpl">
402 f0d1af93 Carlos Eduardo Ramos
						<?=gettext("Use a space to separate multiple hosts (only one " .
403
						"required). Remember to set up at least one DNS server " .
404
						"if you enter a host name here!"); ?>
405 77446beb Matthew Grooms
					</span>
406
				</td>
407
			</tr>
408 3e139f90 Vinicius Coque
			<tr>
409
				<td width="22%" valign="top" class="vncell"><?php echo gettext("Language");?></td>
410
				<td width="78%" class="vtable">
411
					<select name="language">
412
						<?php
413
						foreach(get_locale_list() as $lcode => $ldesc) {
414 925020e7 Colin Fleming
							$selected = ' selected="selected"';
415 3e139f90 Vinicius Coque
							if($lcode != $pconfig['language'])
416
								$selected = '';
417
							echo "<option value=\"{$lcode}\"{$selected}>{$ldesc}</option>";
418
						}
419
						?>
420
					</select>
421
					<strong>
422
						<?=gettext("Choose a language for the webConfigurator"); ?>
423
					</strong>
424
				</td>
425
			</tr>
426 77446beb Matthew Grooms
			<tr>
427
				<td colspan="2" class="list" height="12">&nbsp;</td>
428
			</tr>
429 8b289232 Chris Buechler
			<?php if (! $g['disablethemeselection']): ?>
430 77446beb Matthew Grooms
			<tr>
431 7465d12c Carlos Eduardo Ramos
				<td colspan="2" valign="top" class="listtopic"><?=gettext("Theme"); ?></td>
432 77446beb Matthew Grooms
			</tr>
433
			<tr>
434
				<td width="22%" valign="top" class="vncell">&nbsp;</td>
435
				<td width="78%" class="vtable">
436
					<select name="theme">
437
						<?php
438
							$files = return_dir_as_array("/usr/local/www/themes/");
439
							foreach($files as $f):
440
								if ((substr($f, 0, 1) == "_") && !isset($config['system']['developer']))
441
									continue;
442
								if ($f == "CVS")
443
									continue;
444
								$curtheme = "pfsense";
445
								if ($config['theme'])
446
									$curtheme = $config['theme'];
447
								$selected = "";
448
								if($f == $curtheme)
449 925020e7 Colin Fleming
									$selected = " selected=\"selected\"";
450 77446beb Matthew Grooms
						?>
451
						<option <?=$selected;?>><?=$f;?></option>
452
						<?php endforeach; ?>
453
					</select>
454
					<strong>
455 7465d12c Carlos Eduardo Ramos
						<?=gettext("This will change the look and feel of"); ?>
456 77446beb Matthew Grooms
						<?=$g['product_name'];?>.
457
					</strong>
458
				</td>
459
			</tr>
460 8b289232 Chris Buechler
			<?php endif; ?>
461 306f082a Scott Ullrich
			<tr>
462
				<td colspan="2" class="list" height="12">&nbsp;</td>
463
			</tr>			
464 77446beb Matthew Grooms
			<tr>
465
				<td width="22%" valign="top">&nbsp;</td>
466
				<td width="78%">
467 925020e7 Colin Fleming
					<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" />
468 f0f7a3eb Scott Ullrich
				</td>
469 77446beb Matthew Grooms
			</tr>
470
		</table>
471 27b07eda Ermal Lu?i
		</div>
472
		</td></tr>
473
		</table>
474 77446beb Matthew Grooms
	</form>
475 5b237745 Scott Ullrich
<?php include("fend.inc"); ?>
476 2f3f316c Scott Ullrich
</body>
477
</html>