Project

General

Profile

Download (22.1 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * system.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
7
 * All rights reserved.
8
 *
9
 * originally based on m0n0wall (http://m0n0.ch/wall)
10
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
11
 * All rights reserved.
12
 *
13
 * Licensed under the Apache License, Version 2.0 (the "License");
14
 * you may not use this file except in compliance with the License.
15
 * You may obtain a copy of the License at
16
 *
17
 * http://www.apache.org/licenses/LICENSE-2.0
18
 *
19
 * Unless required by applicable law or agreed to in writing, software
20
 * distributed under the License is distributed on an "AS IS" BASIS,
21
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22
 * See the License for the specific language governing permissions and
23
 * limitations under the License.
24
 */
25

    
26
##|+PRIV
27
##|*IDENT=page-system-generalsetup
28
##|*NAME=System: General Setup
29
##|*DESCR=Allow access to the 'System: General Setup' page.
30
##|*MATCH=system.php*
31
##|-PRIV
32

    
33
require_once("guiconfig.inc");
34
require_once("functions.inc");
35
require_once("filter.inc");
36
require_once("shaper.inc");
37
require_once("system.inc");
38

    
39
$pconfig['hostname'] = $config['system']['hostname'];
40
$pconfig['domain'] = $config['system']['domain'];
41
$pconfig['dnsserver'] = $config['system']['dnsserver'];
42

    
43
$arr_gateways = return_gateways_array();
44

    
45
// set default columns to two if unset
46
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
47
	$config['system']['webgui']['dashboardcolumns'] = 2;
48
}
49

    
50
$dnsgw_counter = 1;
51

    
52
while (isset($config["system"]["dns{$dnsgw_counter}gw"])) {
53
	$pconfig_dnsgw_counter = $dnsgw_counter - 1;
54
	$pconfig["dnsgw{$pconfig_dnsgw_counter}"] = $config["system"]["dns{$dnsgw_counter}gw"];
55
	$dnsgw_counter++;
56
}
57

    
58
$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
59
$pconfig['timezone'] = $config['system']['timezone'];
60
$pconfig['timeservers'] = $config['system']['timeservers'];
61
$pconfig['language'] = $config['system']['language'];
62
$pconfig['webguicss'] = $config['system']['webgui']['webguicss'];
63
$pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu'];
64
$pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns'];
65
$pconfig['interfacessort'] = isset($config['system']['webgui']['interfacessort']);
66
$pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']);
67
$pconfig['disablealiaspopupdetail'] = isset($config['system']['webgui']['disablealiaspopupdetail']);
68
$pconfig['dashboardavailablewidgetspanel'] = isset($config['system']['webgui']['dashboardavailablewidgetspanel']);
69
$pconfig['systemlogsfilterpanel'] = isset($config['system']['webgui']['systemlogsfilterpanel']);
70
$pconfig['systemlogsmanagelogpanel'] = isset($config['system']['webgui']['systemlogsmanagelogpanel']);
71
$pconfig['statusmonitoringsettingspanel'] = isset($config['system']['webgui']['statusmonitoringsettingspanel']);
72
$pconfig['webguihostnamemenu'] = $config['system']['webgui']['webguihostnamemenu'];
73
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
74
$pconfig['dashboardperiod'] = isset($config['widgets']['period']) ? $config['widgets']['period']:"10";
75
$pconfig['loginshowhost'] = isset($config['system']['webgui']['loginshowhost']);
76
$pconfig['requirestatefilter'] = isset($config['system']['webgui']['requirestatefilter']);
77

    
78
if (!$pconfig['timezone']) {
79
	if (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
80
		$pconfig['timezone'] = $g['default_timezone'];
81
	} else {
82
		$pconfig['timezone'] = "Etc/UTC";
83
	}
84
}
85

    
86
if (!$pconfig['timeservers']) {
87
	$pconfig['timeservers'] = "pool.ntp.org";
88
}
89

    
90
$changedesc = gettext("System") . ": ";
91
$changecount = 0;
92

    
93
function is_timezone($elt) {
94
	return !preg_match("/\/$/", $elt);
95
}
96

    
97
if ($pconfig['timezone'] <> $_POST['timezone']) {
98
	filter_pflog_start(true);
99
}
100

    
101
$timezonelist = system_get_timezone_list();
102
$timezonedesc = $timezonelist;
103

    
104
/*
105
 * Etc/GMT entries work the opposite way to what people expect.
106
 * Ref: https://github.com/eggert/tz/blob/master/etcetera and Redmine issue 7089
107
 * Add explanatory text to entries like:
108
 * Etc/GMT+1 and Etc/GMT-1
109
 * but not:
110
 * Etc/GMT or Etc/GMT+0
111
 */
112
foreach ($timezonedesc as $idx => $desc) {
113
	if (substr($desc, 0, 7) != "Etc/GMT" || substr($desc, 8, 1) == "0") {
114
		continue;
115
	}
116

    
117
	$direction = substr($desc, 7, 1);
118

    
119
	switch ($direction) {
120
	case '-':
121
		$direction_str = gettext('AHEAD of');
122
		break;
123
	case '+':
124
		$direction_str = gettext('BEHIND');
125
		break;
126
	default:
127
		continue;
128
	}
129

    
130
	$hr_offset = substr($desc, 8);
131
	$timezonedesc[$idx] = $desc . " " .
132
	    sprintf(ngettext('(%1$s hour %2$s GMT)', '(%1$s hours %2$s GMT)', $hr_offset), $hr_offset, $direction_str);
133
}
134

    
135
$multiwan = false;
136
$interfaces = get_configured_interface_list();
137
foreach ($interfaces as $interface) {
138
	if (interface_has_gateway($interface)) {
139
		$multiwan = true;
140
	}
141
}
142

    
143
if ($_POST) {
144

    
145
	$changecount++;
146

    
147
	unset($input_errors);
148
	$pconfig = $_POST;
149

    
150
	/* input validation */
151
	$reqdfields = explode(" ", "hostname domain");
152
	$reqdfieldsn = array(gettext("Hostname"), gettext("Domain"));
153

    
154
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
155

    
156
	if ($_POST['dashboardperiod']) {
157
		$config['widgets']['period'] = $_POST['dashboardperiod'];
158
	}
159

    
160
	if ($_POST['webguicss']) {
161
		$config['system']['webgui']['webguicss'] = $_POST['webguicss'];
162
	} else {
163
		unset($config['system']['webgui']['webguicss']);
164
	}
165

    
166
	$config['system']['webgui']['loginshowhost'] = $_POST['loginshowhost'] ? true:false;
167

    
168
	if ($_POST['webguifixedmenu']) {
169
		$config['system']['webgui']['webguifixedmenu'] = $_POST['webguifixedmenu'];
170
	} else {
171
		unset($config['system']['webgui']['webguifixedmenu']);
172
	}
173

    
174
	if ($_POST['webguihostnamemenu']) {
175
		$config['system']['webgui']['webguihostnamemenu'] = $_POST['webguihostnamemenu'];
176
	} else {
177
		unset($config['system']['webgui']['webguihostnamemenu']);
178
	}
179

    
180
	if ($_POST['dashboardcolumns']) {
181
		$config['system']['webgui']['dashboardcolumns'] = $_POST['dashboardcolumns'];
182
	} else {
183
		unset($config['system']['webgui']['dashboardcolumns']);
184
	}
185

    
186
	$config['system']['webgui']['requirestatefilter'] = $_POST['requirestatefilter'] ? true : false;
187

    
188
	if ($_POST['hostname']) {
189
		if (!is_hostname($_POST['hostname'])) {
190
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'.");
191
		} else {
192
			if (!is_unqualified_hostname($_POST['hostname'])) {
193
				$input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
194
			}
195
		}
196
	}
197
	if ($_POST['domain'] && !is_domain($_POST['domain'])) {
198
		$input_errors[] = gettext("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
199
	}
200

    
201
	$dnslist = $ignore_posted_dnsgw = array();
202

    
203
	$dnscounter = 0;
204
	$dnsname = "dns{$dnscounter}";
205

    
206
	while (isset($_POST[$dnsname])) {
207
		$dnsgwname = "dnsgw{$dnscounter}";
208
		$dnslist[] = $_POST[$dnsname];
209

    
210
		if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
211
			$input_errors[] = sprintf(gettext("A valid IP address must be specified for DNS server %s."), $dnscounter+1);
212
		} else {
213
			if (($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
214
				// A real gateway has been selected.
215
				if (is_ipaddr($_POST[$dnsname])) {
216
					if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
217
						$input_errors[] = sprintf(gettext('The IPv6 gateway "%1$s" can not be specified for IPv4 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
218
					}
219
					if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
220
						$input_errors[] = sprintf(gettext('The IPv4 gateway "%1$s" can not be specified for IPv6 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
221
					}
222
				} else {
223
					// The user selected a gateway but did not provide a DNS address. Be nice and set the gateway back to "none".
224
					$ignore_posted_dnsgw[$dnsgwname] = true;
225
				}
226
			}
227
		}
228
		$dnscounter++;
229
		$dnsname = "dns{$dnscounter}";
230
	}
231

    
232
	if (count(array_filter($dnslist)) != count(array_unique(array_filter($dnslist)))) {
233
		$input_errors[] = gettext('Each configured DNS server must have a unique IP address. Remove the duplicated IP.');
234
	}
235

    
236
	$dnscounter = 0;
237
	$dnsname = "dns{$dnscounter}";
238

    
239
	$direct_networks_list = explode(" ", filter_get_direct_networks_list());
240
	while (isset($_POST[$dnsname])) {
241
		$dnsgwname = "dnsgw{$dnscounter}";
242
		if ($_POST[$dnsgwname] && ($_POST[$dnsgwname] <> "none")) {
243
			foreach ($direct_networks_list as $direct_network) {
244
				if (ip_in_subnet($_POST[$dnsname], $direct_network)) {
245
					$input_errors[] = sprintf(gettext("A gateway can not be assigned to DNS '%s' server which is on a directly connected network."), $_POST[$dnsname]);
246
				}
247
			}
248
		}
249
		$dnscounter++;
250
		$dnsname = "dns{$dnscounter}";
251
	}
252

    
253
	# it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
254
	$_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
255
	$_POST['timeservers'] = trim($_POST['timeservers']);
256
	foreach (explode(' ', $_POST['timeservers']) as $ts) {
257
		if (!is_domain($ts)) {
258
			$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
259
		}
260
	}
261

    
262
	if ($input_errors) {
263
		// Put the user-entered list back into place so it will be redisplayed for correction.
264
		$pconfig['dnsserver'] = $dnslist;
265
	} else {
266
		update_if_changed("hostname", $config['system']['hostname'], $_POST['hostname']);
267
		update_if_changed("domain", $config['system']['domain'], $_POST['domain']);
268
		update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
269
		update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
270

    
271
		if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
272
			$config['system']['language'] = $_POST['language'];
273
			set_language();
274
		}
275

    
276
		unset($config['system']['webgui']['interfacessort']);
277
		$config['system']['webgui']['interfacessort'] = $_POST['interfacessort'] ? true : false;
278

    
279
		unset($config['system']['webgui']['webguileftcolumnhyper']);
280
		$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
281

    
282
		unset($config['system']['webgui']['disablealiaspopupdetail']);
283
		$config['system']['webgui']['disablealiaspopupdetail'] = $_POST['disablealiaspopupdetail'] ? true : false;
284

    
285
		unset($config['system']['webgui']['dashboardavailablewidgetspanel']);
286
		$config['system']['webgui']['dashboardavailablewidgetspanel'] = $_POST['dashboardavailablewidgetspanel'] ? true : false;
287

    
288
		unset($config['system']['webgui']['systemlogsfilterpanel']);
289
		$config['system']['webgui']['systemlogsfilterpanel'] = $_POST['systemlogsfilterpanel'] ? true : false;
290

    
291
		unset($config['system']['webgui']['systemlogsmanagelogpanel']);
292
		$config['system']['webgui']['systemlogsmanagelogpanel'] = $_POST['systemlogsmanagelogpanel'] ? true : false;
293

    
294
		unset($config['system']['webgui']['statusmonitoringsettingspanel']);
295
		$config['system']['webgui']['statusmonitoringsettingspanel'] = $_POST['statusmonitoringsettingspanel'] ? true : false;
296

    
297
		/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
298
		$olddnsservers = $config['system']['dnsserver'];
299
		unset($config['system']['dnsserver']);
300

    
301
		$dnscounter = 0;
302
		$dnsname = "dns{$dnscounter}";
303

    
304
		while (isset($_POST[$dnsname])) {
305
			if ($_POST[$dnsname]) {
306
				$config['system']['dnsserver'][] = $_POST[$dnsname];
307
			}
308
			$dnscounter++;
309
			$dnsname = "dns{$dnscounter}";
310
		}
311

    
312
		// Remember the new list for display also.
313
		$pconfig['dnsserver'] = $config['system']['dnsserver'];
314

    
315
		$olddnsallowoverride = $config['system']['dnsallowoverride'];
316

    
317
		unset($config['system']['dnsallowoverride']);
318
		$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
319

    
320
		if ($_POST['dnslocalhost'] == "yes") {
321
			$config['system']['dnslocalhost'] = true;
322
		} else {
323
			unset($config['system']['dnslocalhost']);
324
		}
325

    
326
		/* which interface should the dns servers resolve through? */
327
		$dnscounter = 0;
328
		// The $_POST array key of the DNS IP (starts from 0)
329
		$dnsname = "dns{$dnscounter}";
330
		$outdnscounter = 0;
331
		while (isset($_POST[$dnsname])) {
332
			// The $_POST array key of the corresponding gateway (starts from 0)
333
			$dnsgwname = "dnsgw{$dnscounter}";
334
			// The numbering of DNS GW entries in the config starts from 1
335
			$dnsgwconfigcounter = $dnscounter + 1;
336
			// So this is the array key of the DNS GW entry in $config['system']
337
			$dnsgwconfigname = "dns{$dnsgwconfigcounter}gw";
338

    
339
			$olddnsgwname = $config['system'][$dnsgwconfigname];
340

    
341
			if ($ignore_posted_dnsgw[$dnsgwname]) {
342
				$thisdnsgwname = "none";
343
			} else {
344
				$thisdnsgwname = $pconfig[$dnsgwname];
345
			}
346

    
347
			// "Blank" out the settings for this index, then we set them below using the "outdnscounter" index.
348
			$config['system'][$dnsgwconfigname] = "none";
349
			$pconfig[$dnsgwname] = "none";
350
			$pconfig[$dnsname] = "";
351

    
352
			if ($_POST[$dnsname]) {
353
				// Only the non-blank DNS servers were put into the config above.
354
				// So we similarly only add the corresponding gateways sequentially to the config (and to pconfig), as we find non-blank DNS servers.
355
				// 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.
356

    
357
				// The $pconfig array key of the DNS IP (starts from 0)
358
				$outdnsname = "dns{$outdnscounter}";
359
				// The $pconfig array key of the corresponding gateway (starts from 0)
360
				$outdnsgwname = "dnsgw{$outdnscounter}";
361
				// The numbering of DNS GW entries in the config starts from 1
362
				$outdnsgwconfigcounter = $outdnscounter + 1;
363
				// So this is the array key of the output DNS GW entry in $config['system']
364
				$outdnsgwconfigname = "dns{$outdnsgwconfigcounter}gw";
365

    
366
				$pconfig[$outdnsname] = $_POST[$dnsname];
367
				if ($_POST[$dnsgwname]) {
368
					$config['system'][$outdnsgwconfigname] = $thisdnsgwname;
369
					$pconfig[$outdnsgwname] = $thisdnsgwname;
370
				} else {
371
					// Note: when no DNS GW name is chosen, the entry is set to "none", so actually this case never happens.
372
					unset($config['system'][$outdnsgwconfigname]);
373
					$pconfig[$outdnsgwname] = "";
374
				}
375
				$outdnscounter++;
376
			}
377
			if (($olddnsgwname != "") && ($olddnsgwname != "none") && (($olddnsgwname != $thisdnsgwname) || ($olddnsservers[$dnscounter] != $_POST[$dnsname]))) {
378
				// A previous DNS GW name was specified. It has now gone or changed, or the DNS server address has changed.
379
				// Remove the route. Later calls will add the correct new route if needed.
380
				if (is_ipaddrv4($olddnsservers[$dnscounter])) {
381
					mwexec("/sbin/route delete " . escapeshellarg($olddnsservers[$dnscounter-1]));
382
				} else if (is_ipaddrv6($olddnsservers[$dnscounter])) {
383
					mwexec("/sbin/route delete -inet6 " . escapeshellarg($olddnsservers[$dnscounter-1]));
384
				}
385
			}
386

    
387
			$dnscounter++;
388
			// The $_POST array key of the DNS IP (starts from 0)
389
			$dnsname = "dns{$dnscounter}";
390
		}
391

    
392
		if ($changecount > 0) {
393
			write_config($changedesc);
394
		}
395

    
396
		$changes_applied = true;
397
		$retval = 0;
398
		$retval |= system_hostname_configure();
399
		$retval |= system_hosts_generate();
400
		$retval |= system_resolvconf_generate();
401
		if (isset($config['dnsmasq']['enable'])) {
402
			$retval |= services_dnsmasq_configure();
403
		} elseif (isset($config['unbound']['enable'])) {
404
			$retval |= services_unbound_configure();
405
		}
406
		$retval |= system_timezone_configure();
407
		$retval |= system_ntp_configure();
408

    
409
		if ($olddnsallowoverride != $config['system']['dnsallowoverride']) {
410
			$retval |= send_event("service reload dns");
411
		}
412

    
413
		// Reload the filter - plugins might need to be run.
414
		$retval |= filter_configure();
415
	}
416

    
417
	unset($ignore_posted_dnsgw);
418
}
419

    
420
$pgtitle = array(gettext("System"), gettext("General Setup"));
421
include("head.inc");
422

    
423
if ($input_errors) {
424
	print_input_errors($input_errors);
425
}
426

    
427
if ($changes_applied) {
428
	print_apply_result_box($retval);
429
}
430
?>
431
<div id="container">
432
<?php
433

    
434
$form = new Form;
435
$section = new Form_Section('System');
436
$section->addInput(new Form_Input(
437
	'hostname',
438
	'*Hostname',
439
	'text',
440
	$pconfig['hostname'],
441
	['placeholder' => 'pfSense']
442
))->setHelp('Name of the firewall host, without domain part');
443

    
444
$section->addInput(new Form_Input(
445
	'domain',
446
	'*Domain',
447
	'text',
448
	$pconfig['domain'],
449
	['placeholder' => 'mycorp.com, home, office, private, etc.']
450
))->setHelp('Do not use \'local\' as a domain name. It will cause local '.
451
	'hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve '.
452
	'local hosts not running mDNS.');
453

    
454
$form->add($section);
455

    
456
$section = new Form_Section('DNS Server Settings');
457

    
458
if (!is_array($pconfig['dnsserver'])) {
459
	$pconfig['dnsserver'] = array();
460
}
461

    
462
$dnsserver_count = count($pconfig['dnsserver']);
463
$dnsserver_num = 0;
464
$dnsserver_help = gettext("Address") . '<br/>' . gettext("Enter IP addresses to be used by the system for DNS resolution.") . " " .
465
	gettext("These are also used for the DHCP service, DNS Forwarder and DNS Resolver when it has DNS Query Forwarding enabled.");
466
$dnsgw_help = gettext("Gateway") . '<br/>'. gettext("Optionally select the gateway for each DNS server.") . " " .
467
	gettext("When using multiple WAN connections there should be at least one unique DNS server per gateway.");
468

    
469
// If there are no DNS servers, make an empty entry for initial display.
470
if ($dnsserver_count == 0) {
471
	$pconfig['dnsserver'][] = '';
472
}
473

    
474
foreach ($pconfig['dnsserver'] as $dnsserver) {
475

    
476
	$is_last_dnsserver = ($dnsserver_num == $dnsserver_count - 1);
477
	$group = new Form_Group($dnsserver_num == 0 ? 'DNS Servers':'');
478
	$group->addClass('repeatable');
479

    
480
	$group->add(new Form_Input(
481
		'dns' . $dnsserver_num,
482
		'DNS Server',
483
		'text',
484
		$dnsserver
485
	))->setHelp(($is_last_dnsserver) ? $dnsserver_help:null);
486

    
487
	if ($multiwan)	{
488
		$options = array('none' => 'none');
489

    
490
		foreach ($arr_gateways as $gwname => $gwitem) {
491
			if ((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
492
				continue;
493
			}
494

    
495
			if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
496
				continue;
497
			}
498

    
499
			$options[$gwname] = $gwname.' - '.$gwitem['friendlyiface'].' - '.$gwitem['gateway'];
500
		}
501

    
502
		$group->add(new Form_Select(
503
			'dnsgw' . $dnsserver_num,
504
			'Gateway',
505
			$pconfig['dnsgw' . $dnsserver_num],
506
			$options
507
		))->setHelp(($is_last_dnsserver) ? $dnsgw_help:null);;
508
	}
509

    
510
	$group->add(new Form_Button(
511
		'deleterow' . $dnsserver_num,
512
		'Delete',
513
		null,
514
		'fa-trash'
515
	))->addClass('btn-warning');
516

    
517
	$section->add($group);
518
	$dnsserver_num++;
519
}
520

    
521
$section->addInput(new Form_Button(
522
	'addrow',
523
	'Add DNS Server',
524
	null,
525
	'fa-plus'
526
))->addClass('btn-success addbtn');
527

    
528
$section->addInput(new Form_Checkbox(
529
	'dnsallowoverride',
530
	'DNS Server Override',
531
	'Allow DNS server list to be overridden by DHCP/PPP on WAN',
532
	$pconfig['dnsallowoverride']
533
))->setHelp('If this option is set, %s will use DNS servers '.
534
	'assigned by a DHCP/PPP server on WAN for its own purposes (including '.
535
	'the DNS Forwarder/DNS Resolver). However, they will not be assigned to DHCP '.
536
	'clients.', $g['product_name']);
537

    
538
$section->addInput(new Form_Checkbox(
539
	'dnslocalhost',
540
	'Disable DNS Forwarder',
541
	'Do not use the DNS Forwarder/DNS Resolver as a DNS server for the firewall',
542
	$pconfig['dnslocalhost']
543
))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS '.
544
	'server where the DNS Forwarder or DNS Resolver is enabled and set to '.
545
	'listen on localhost, so system can use the local DNS service to perform '.
546
	'lookups. Checking this box omits localhost from the list of DNS servers in resolv.conf.');
547

    
548
$form->add($section);
549

    
550
$section = new Form_Section('Localization');
551

    
552
$section->addInput(new Form_Select(
553
	'timezone',
554
	'*Timezone',
555
	$pconfig['timezone'],
556
	array_combine($timezonelist, $timezonedesc)
557
))->setHelp('Select a geographic region name (Continent/Location) to determine the timezone for the firewall. %1$s' .
558
	'Choose a special or "Etc" zone only in cases where the geographic zones do not properly handle the clock offset required for this firewall.', '<br/>');
559

    
560
$section->addInput(new Form_Input(
561
	'timeservers',
562
	'Timeservers',
563
	'text',
564
	$pconfig['timeservers']
565
))->setHelp('Use a space to separate multiple hosts (only one required). '.
566
	'Remember to set up at least one DNS server if a host name is entered here!');
567

    
568
$section->addInput(new Form_Select(
569
	'language',
570
	'*Language',
571
	$pconfig['language'],
572
	get_locale_list()
573
))->setHelp('Choose a language for the webConfigurator');
574

    
575
$form->add($section);
576

    
577
$section = new Form_Section('webConfigurator');
578

    
579
gen_webguicss_field($section, $pconfig['webguicss']);
580
gen_webguifixedmenu_field($section, $pconfig['webguifixedmenu']);
581
gen_webguihostnamemenu_field($section, $pconfig['webguihostnamemenu']);
582
gen_dashboardcolumns_field($section, $pconfig['dashboardcolumns']);
583
gen_interfacessort_field($section, $pconfig['interfacessort']);
584
gen_associatedpanels_fields(
585
	$section,
586
	$pconfig['dashboardavailablewidgetspanel'],
587
	$pconfig['systemlogsfilterpanel'],
588
	$pconfig['systemlogsmanagelogpanel'],
589
	$pconfig['statusmonitoringsettingspanel']);
590
gen_requirestatefilter_field($section, $pconfig['requirestatefilter']);
591
gen_webguileftcolumnhyper_field($section, $pconfig['webguileftcolumnhyper']);
592
gen_disablealiaspopupdetail_field($section, $pconfig['disablealiaspopupdetail']);
593

    
594
$section->addInput(new Form_Checkbox(
595
	'loginshowhost',
596
	'Login hostname',
597
	'Show hostname on login banner',
598
	$pconfig['loginshowhost']
599
));
600

    
601
$section->addInput(new Form_Input(
602
	'dashboardperiod',
603
	'Dashboard update period',
604
	'number',
605
	$pconfig['dashboardperiod'],
606
	['min' => '5', 'max' => '600']
607
))->setHelp('Time in seconds between dashboard widget updates. Small values cause ' .
608
			'more frequent updates but increase the load on the web server. ' .
609
			'Minimum is 5 seconds, maximum 600 seconds');
610

    
611
$form->add($section);
612

    
613
print $form;
614

    
615
$csswarning = sprintf(gettext("%sUser-created themes are unsupported, use at your own risk."), "<br />");
616

    
617
?>
618
</div>
619

    
620
<script type="text/javascript">
621
//<![CDATA[
622
events.push(function() {
623

    
624
	function setThemeWarning() {
625
		if ($('#webguicss').val().startsWith("pfSense")) {
626
			$('#csstxt').html("").addClass("text-default");
627
		} else {
628
			$('#csstxt').html("<?=$csswarning?>").addClass("text-danger");
629
		}
630
	}
631

    
632
	$('#webguicss').change(function() {
633
		setThemeWarning();
634
	});
635

    
636
	setThemeWarning();
637

    
638
	// Suppress "Delete row" button if there are fewer than two rows
639
	checkLastRow();
640
});
641
//]]>
642
</script>
643

    
644
<?php
645
include("foot.inc");
646
?>
(182-182/223)