Project

General

Profile

Download (20 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
 * Redistribution and use in source and binary forms, with or without
14
 * modification, are permitted provided that the following conditions are met:
15
 *
16
 * 1. Redistributions of source code must retain the above copyright notice,
17
 *    this list of conditions and the following disclaimer.
18
 *
19
 * 2. Redistributions in binary form must reproduce the above copyright
20
 *    notice, this list of conditions and the following disclaimer in
21
 *    the documentation and/or other materials provided with the
22
 *    distribution.
23
 *
24
 * 3. All advertising materials mentioning features or use of this software
25
 *    must display the following acknowledgment:
26
 *    "This product includes software developed by the pfSense Project
27
 *    for use in the pfSense® software distribution. (http://www.pfsense.org/).
28
 *
29
 * 4. The names "pfSense" and "pfSense Project" must not be used to
30
 *    endorse or promote products derived from this software without
31
 *    prior written permission. For written permission, please contact
32
 *    coreteam@pfsense.org.
33
 *
34
 * 5. Products derived from this software may not be called "pfSense"
35
 *    nor may "pfSense" appear in their names without prior written
36
 *    permission of the Electric Sheep Fencing, LLC.
37
 *
38
 * 6. Redistributions of any form whatsoever must retain the following
39
 *    acknowledgment:
40
 *
41
 * "This product includes software developed by the pfSense Project
42
 * for use in the pfSense software distribution (http://www.pfsense.org/).
43
 *
44
 * THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
45
 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
46
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
47
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
48
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
49
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
50
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
51
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
52
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
53
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
54
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
55
 * OF THE POSSIBILITY OF SUCH DAMAGE.
56
 */
57

    
58
##|+PRIV
59
##|*IDENT=page-system-generalsetup
60
##|*NAME=System: General Setup
61
##|*DESCR=Allow access to the 'System: General Setup' page.
62
##|*MATCH=system.php*
63
##|-PRIV
64

    
65
require_once("guiconfig.inc");
66
require_once("functions.inc");
67
require_once("filter.inc");
68
require_once("shaper.inc");
69
require_once("system.inc");
70

    
71
$pconfig['hostname'] = $config['system']['hostname'];
72
$pconfig['domain'] = $config['system']['domain'];
73
list($pconfig['dns1'], $pconfig['dns2'], $pconfig['dns3'], $pconfig['dns4']) = $config['system']['dnsserver'];
74

    
75
$arr_gateways = return_gateways_array();
76

    
77
// set default columns to two if unset
78
if (!isset($config['system']['webgui']['dashboardcolumns'])) {
79
	$config['system']['webgui']['dashboardcolumns'] = 2;
80
}
81

    
82
$pconfig['dns1gw'] = $config['system']['dns1gw'];
83
$pconfig['dns2gw'] = $config['system']['dns2gw'];
84
$pconfig['dns3gw'] = $config['system']['dns3gw'];
85
$pconfig['dns4gw'] = $config['system']['dns4gw'];
86

    
87
$pconfig['dnsallowoverride'] = isset($config['system']['dnsallowoverride']);
88
$pconfig['timezone'] = $config['system']['timezone'];
89
$pconfig['timeservers'] = $config['system']['timeservers'];
90
$pconfig['language'] = $config['system']['language'];
91
$pconfig['webguicss'] = $config['system']['webgui']['webguicss'];
92
$pconfig['webguifixedmenu'] = $config['system']['webgui']['webguifixedmenu'];
93
$pconfig['dashboardcolumns'] = $config['system']['webgui']['dashboardcolumns'];
94
$pconfig['webguileftcolumnhyper'] = isset($config['system']['webgui']['webguileftcolumnhyper']);
95
$pconfig['dashboardavailablewidgetspanel'] = isset($config['system']['webgui']['dashboardavailablewidgetspanel']);
96
$pconfig['systemlogsfilterpanel'] = isset($config['system']['webgui']['systemlogsfilterpanel']);
97
$pconfig['systemlogsmanagelogpanel'] = isset($config['system']['webgui']['systemlogsmanagelogpanel']);
98
$pconfig['statusmonitoringsettingspanel'] = isset($config['system']['webgui']['statusmonitoringsettingspanel']);
99
$pconfig['webguihostnamemenu'] = $config['system']['webgui']['webguihostnamemenu'];
100
$pconfig['dnslocalhost'] = isset($config['system']['dnslocalhost']);
101
$pconfig['dashboardperiod'] = isset($config['widgets']['period']) ? $config['widgets']['period']:"10";
102
$pconfig['loginshowhost'] = isset($config['system']['webgui']['loginshowhost']);
103

    
104
if (!$pconfig['timezone']) {
105
	if (isset($g['default_timezone']) && !empty($g['default_timezone'])) {
106
		$pconfig['timezone'] = $g['default_timezone'];
107
	} else {
108
		$pconfig['timezone'] = "Etc/UTC";
109
	}
110
}
111

    
112
if (!$pconfig['timeservers']) {
113
	$pconfig['timeservers'] = "pool.ntp.org";
114
}
115

    
116
$changedesc = gettext("System") . ": ";
117
$changecount = 0;
118

    
119
function is_timezone($elt) {
120
	return !preg_match("/\/$/", $elt);
121
}
122

    
123
if ($pconfig['timezone'] <> $_POST['timezone']) {
124
	filter_pflog_start(true);
125
}
126

    
127
$timezonelist = system_get_timezone_list();
128

    
129
$multiwan = false;
130
$interfaces = get_configured_interface_list();
131
foreach ($interfaces as $interface) {
132
	if (interface_has_gateway($interface)) {
133
		$multiwan = true;
134
	}
135
}
136

    
137
if ($_POST) {
138

    
139
	$changecount++;
140

    
141
	unset($input_errors);
142
	$pconfig = $_POST;
143

    
144
	/* input validation */
145
	$reqdfields = explode(" ", "hostname domain");
146
	$reqdfieldsn = array(gettext("Hostname"), gettext("Domain"));
147

    
148
	do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
149

    
150
	if ($_POST['dashboardperiod']) {
151
		$config['widgets']['period'] = $_POST['dashboardperiod'];
152
	}
153

    
154
	if ($_POST['webguicss']) {
155
		$config['system']['webgui']['webguicss'] = $_POST['webguicss'];
156
	} else {
157
		unset($config['system']['webgui']['webguicss']);
158
	}
159

    
160
	$config['system']['webgui']['loginshowhost'] = $_POST['loginshowhost'] ? true:false;
161

    
162
	if ($_POST['webguifixedmenu']) {
163
		$config['system']['webgui']['webguifixedmenu'] = $_POST['webguifixedmenu'];
164
	} else {
165
		unset($config['system']['webgui']['webguifixedmenu']);
166
	}
167

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

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

    
180
	if ($_POST['hostname']) {
181
		if (!is_hostname($_POST['hostname'])) {
182
			$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'. It may not start or end with '-'.");
183
		} else {
184
			if (!is_unqualified_hostname($_POST['hostname'])) {
185
				$input_errors[] = gettext("A valid hostname is specified, but the domain name part should be omitted");
186
			}
187
		}
188
	}
189
	if ($_POST['domain'] && !is_domain($_POST['domain'])) {
190
		$input_errors[] = gettext("The domain may only contain the characters a-z, 0-9, '-' and '.'.");
191
	}
192

    
193
	$dnslist = $ignore_posted_dnsgw = array();
194

    
195
	for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
196
		$dnsname="dns{$dnscounter}";
197
		$dnsgwname="dns{$dnscounter}gw";
198
		$dnslist[] = $_POST[$dnsname];
199

    
200
		if (($_POST[$dnsname] && !is_ipaddr($_POST[$dnsname]))) {
201
			$input_errors[] = sprintf(gettext("A valid IP address must be specified for DNS server %s."), $dnscounter);
202
		} else {
203
			if (($_POST[$dnsgwname] <> "") && ($_POST[$dnsgwname] <> "none")) {
204
				// A real gateway has been selected.
205
				if (is_ipaddr($_POST[$dnsname])) {
206
					if ((is_ipaddrv4($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
207
						$input_errors[] = sprintf(gettext('The IPv6 gateway "%1$s" can not be specified for IPv4 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
208
					}
209
					if ((is_ipaddrv6($_POST[$dnsname])) && (validate_address_family($_POST[$dnsname], $_POST[$dnsgwname]) === false)) {
210
						$input_errors[] = sprintf(gettext('The IPv4 gateway "%1$s" can not be specified for IPv6 DNS server "%2$s".'), $_POST[$dnsgwname], $_POST[$dnsname]);
211
					}
212
				} else {
213
					// The user selected a gateway but did not provide a DNS address. Be nice and set the gateway back to "none".
214
					$ignore_posted_dnsgw[$dnsgwname] = true;
215
				}
216
			}
217
		}
218
	}
219

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

    
224
	$direct_networks_list = explode(" ", filter_get_direct_networks_list());
225
	for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
226
		$dnsitem = "dns{$dnscounter}";
227
		$dnsgwitem = "dns{$dnscounter}gw";
228
		if ($_POST[$dnsgwitem]) {
229
			if (interface_has_gateway($_POST[$dnsgwitem])) {
230
				foreach ($direct_networks_list as $direct_network) {
231
					if (ip_in_subnet($_POST[$dnsitem], $direct_network)) {
232
						$input_errors[] = sprintf(gettext("A gateway can not be assigned to DNS '%s' server which is on a directly connected network."), $_POST[$dnsitem]);
233
					}
234
				}
235
			}
236
		}
237
	}
238

    
239
	# it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
240
	$_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
241
	$_POST['timeservers'] = trim($_POST['timeservers']);
242
	foreach (explode(' ', $_POST['timeservers']) as $ts) {
243
		if (!is_domain($ts)) {
244
			$input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
245
		}
246
	}
247

    
248
	if (!$input_errors) {
249
		update_if_changed("hostname", $config['system']['hostname'], $_POST['hostname']);
250
		update_if_changed("domain", $config['system']['domain'], $_POST['domain']);
251
		update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
252
		update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
253

    
254
		if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
255
			$config['system']['language'] = $_POST['language'];
256
			set_language();
257
		}
258

    
259
		unset($config['system']['webgui']['webguileftcolumnhyper']);
260
		$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
261

    
262
		unset($config['system']['webgui']['dashboardavailablewidgetspanel']);
263
		$config['system']['webgui']['dashboardavailablewidgetspanel'] = $_POST['dashboardavailablewidgetspanel'] ? true : false;
264

    
265
		unset($config['system']['webgui']['systemlogsfilterpanel']);
266
		$config['system']['webgui']['systemlogsfilterpanel'] = $_POST['systemlogsfilterpanel'] ? true : false;
267

    
268
		unset($config['system']['webgui']['systemlogsmanagelogpanel']);
269
		$config['system']['webgui']['systemlogsmanagelogpanel'] = $_POST['systemlogsmanagelogpanel'] ? true : false;
270

    
271
		unset($config['system']['webgui']['statusmonitoringsettingspanel']);
272
		$config['system']['webgui']['statusmonitoringsettingspanel'] = $_POST['statusmonitoringsettingspanel'] ? true : false;
273

    
274
		/* XXX - billm: these still need updating after figuring out how to check if they actually changed */
275
		$olddnsservers = $config['system']['dnsserver'];
276
		unset($config['system']['dnsserver']);
277
		if ($_POST['dns1']) {
278
			$config['system']['dnsserver'][] = $_POST['dns1'];
279
		}
280
		if ($_POST['dns2']) {
281
			$config['system']['dnsserver'][] = $_POST['dns2'];
282
		}
283
		if ($_POST['dns3']) {
284
			$config['system']['dnsserver'][] = $_POST['dns3'];
285
		}
286
		if ($_POST['dns4']) {
287
			$config['system']['dnsserver'][] = $_POST['dns4'];
288
		}
289

    
290
		$olddnsallowoverride = $config['system']['dnsallowoverride'];
291

    
292
		unset($config['system']['dnsallowoverride']);
293
		$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
294

    
295
		if ($_POST['dnslocalhost'] == "yes") {
296
			$config['system']['dnslocalhost'] = true;
297
		} else {
298
			unset($config['system']['dnslocalhost']);
299
		}
300

    
301
		/* which interface should the dns servers resolve through? */
302
		$outdnscounter = 0;
303
		for ($dnscounter=1; $dnscounter<5; $dnscounter++) {
304
			$dnsname="dns{$dnscounter}";
305
			$dnsgwname="dns{$dnscounter}gw";
306
			$olddnsgwname = $config['system'][$dnsgwname];
307

    
308
			if ($ignore_posted_dnsgw[$dnsgwname]) {
309
				$thisdnsgwname = "none";
310
			} else {
311
				$thisdnsgwname = $pconfig[$dnsgwname];
312
			}
313

    
314
			// "Blank" out the settings for this index, then we set them below using the "outdnscounter" index.
315
			$config['system'][$dnsgwname] = "none";
316
			$pconfig[$dnsgwname] = "none";
317
			$pconfig[$dnsname] = "";
318

    
319
			if ($_POST[$dnsname]) {
320
				// Only the non-blank DNS servers were put into the config above.
321
				// So we similarly only add the corresponding gateways sequentially to the config (and to pconfig), as we find non-blank DNS servers.
322
				// 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.
323
				$outdnscounter++;
324
				$outdnsname="dns{$outdnscounter}";
325
				$outdnsgwname="dns{$outdnscounter}gw";
326
				$pconfig[$outdnsname] = $_POST[$dnsname];
327
				if ($_POST[$dnsgwname]) {
328
					$config['system'][$outdnsgwname] = $thisdnsgwname;
329
					$pconfig[$outdnsgwname] = $thisdnsgwname;
330
				} else {
331
					// Note: when no DNS GW name is chosen, the entry is set to "none", so actually this case never happens.
332
					unset($config['system'][$outdnsgwname]);
333
					$pconfig[$outdnsgwname] = "";
334
				}
335
			}
336
			if (($olddnsgwname != "") && ($olddnsgwname != "none") && (($olddnsgwname != $thisdnsgwname) || ($olddnsservers[$dnscounter-1] != $_POST[$dnsname]))) {
337
				// A previous DNS GW name was specified. It has now gone or changed, or the DNS server address has changed.
338
				// Remove the route. Later calls will add the correct new route if needed.
339
				if (is_ipaddrv4($olddnsservers[$dnscounter-1])) {
340
					mwexec("/sbin/route delete " . escapeshellarg($olddnsservers[$dnscounter-1]));
341
				} else if (is_ipaddrv6($olddnsservers[$dnscounter-1])) {
342
					mwexec("/sbin/route delete -inet6 " . escapeshellarg($olddnsservers[$dnscounter-1]));
343
				}
344
			}
345
		}
346

    
347
		if ($changecount > 0) {
348
			write_config($changedesc);
349
		}
350

    
351
		$retval = 0;
352
		$retval = system_hostname_configure();
353
		$retval |= system_hosts_generate();
354
		$retval |= system_resolvconf_generate();
355
		if (isset($config['dnsmasq']['enable'])) {
356
			$retval |= services_dnsmasq_configure();
357
		} elseif (isset($config['unbound']['enable'])) {
358
			$retval |= services_unbound_configure();
359
		}
360
		$retval |= system_timezone_configure();
361
		$retval |= system_ntp_configure();
362

    
363
		if ($olddnsallowoverride != $config['system']['dnsallowoverride']) {
364
			$retval |= send_event("service reload dns");
365
		}
366

    
367
		// Reload the filter - plugins might need to be run.
368
		$retval |= filter_configure();
369

    
370
		$savemsg = get_std_save_message($retval);
371
	}
372

    
373
	unset($ignore_posted_dnsgw);
374
}
375

    
376
$pgtitle = array(gettext("System"), gettext("General Setup"));
377
include("head.inc");
378

    
379
if ($input_errors) {
380
	print_input_errors($input_errors);
381
}
382

    
383
if ($savemsg) {
384
	print_info_box($savemsg, 'success');
385
}
386
?>
387
<div id="container">
388
<?php
389

    
390
$form = new Form;
391
$section = new Form_Section('System');
392
$section->addInput(new Form_Input(
393
	'hostname',
394
	'Hostname',
395
	'text',
396
	$pconfig['hostname'],
397
	['placeholder' => 'pfSense']
398
))->setHelp('Name of the firewall host, without domain part');
399

    
400
$section->addInput(new Form_Input(
401
	'domain',
402
	'Domain',
403
	'text',
404
	$pconfig['domain'],
405
	['placeholder' => 'mycorp.com, home, office, private, etc.']
406
))->setHelp('Do not use \'local\' as a domain name. It will cause local '.
407
	'hosts running mDNS (avahi, bonjour, etc.) to be unable to resolve '.
408
	'local hosts not running mDNS.');
409

    
410
$form->add($section);
411

    
412
$section = new Form_Section('DNS Server Settings');
413

    
414
for ($i=1; $i<5; $i++) {
415
//	if (!isset($pconfig['dns'.$i]))
416
//		continue;
417

    
418
	$group = new Form_Group('DNS Server ' . $i);
419

    
420
	$group->add(new Form_Input(
421
		'dns' . $i,
422
		'DNS Server',
423
		'text',
424
		$pconfig['dns'. $i]
425
	))->setHelp(($i == 4) ? 'Address':null);
426

    
427
	$help = "Enter IP addresses to be used by the system for DNS resolution. " .
428
		"These are also used for the DHCP service, DNS forwarder and for PPTP VPN clients.";
429

    
430
	if ($multiwan)	{
431
		$options = array('none' => 'none');
432

    
433
		foreach ($arr_gateways as $gwname => $gwitem) {
434
			if ((is_ipaddrv4(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv6($gwitem['gateway'])))) {
435
				continue;
436
			}
437

    
438
			if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
439
				continue;
440
			}
441

    
442
			$options[$gwname] = $gwname.' - '.$gwitem['friendlyiface'].' - '.$gwitem['gateway'];
443
		}
444

    
445
		$group->add(new Form_Select(
446
			'dns' . $i . 'gw',
447
			'Gateway',
448
			$pconfig['dns' . $i . 'gw'],
449
			$options
450
		))->setHelp(($i == 4) ? 'Gateway':null);;
451

    
452
		$help .= '<br/>'. "In addition, optionally select the gateway for each DNS server. " .
453
			"When using multiple WAN connections there should be at least one unique DNS server per gateway.";
454
	}
455

    
456
	if ($i == 4) {
457
		$group->setHelp($help);
458
	}
459

    
460
	$section->add($group);
461
}
462

    
463
$section->addInput(new Form_Checkbox(
464
	'dnsallowoverride',
465
	'DNS Server Override',
466
	'Allow DNS server list to be overridden by DHCP/PPP on WAN',
467
	$pconfig['dnsallowoverride']
468
))->setHelp(sprintf(gettext('If this option is set, %s will use DNS servers '.
469
	'assigned by a DHCP/PPP server on WAN for its own purposes (including '.
470
	'the DNS forwarder). However, they will not be assigned to DHCP and PPTP '.
471
	'VPN clients.'), $g['product_name']));
472

    
473
$section->addInput(new Form_Checkbox(
474
	'dnslocalhost',
475
	'Disable DNS Forwarder',
476
	'Do not use the DNS Forwarder as a DNS server for the firewall',
477
	$pconfig['dnslocalhost']
478
))->setHelp('By default localhost (127.0.0.1) will be used as the first DNS '.
479
	'server where the DNS Forwarder or DNS Resolver is enabled and set to '.
480
	'listen on Localhost, so system can use the local DNS service to perform '.
481
	'lookups. Checking this box omits localhost from the list of DNS servers.');
482

    
483
$form->add($section);
484

    
485
$section = new Form_Section('Localization');
486

    
487
$section->addInput(new Form_Select(
488
	'timezone',
489
	'Timezone',
490
	$pconfig['timezone'],
491
	array_combine($timezonelist, $timezonelist)
492
))->setHelp('Select the timezone or location within the timezone to be used by this system.');
493

    
494
$section->addInput(new Form_Input(
495
	'timeservers',
496
	'Timeservers',
497
	'text',
498
	$pconfig['timeservers']
499
))->setHelp('Use a space to separate multiple hosts (only one required). '.
500
	'Remember to set up at least one DNS server if a host name is entered here!');
501

    
502
$section->addInput(new Form_Select(
503
	'language',
504
	'Language',
505
	$pconfig['language'],
506
	get_locale_list()
507
))->setHelp('Choose a language for the webConfigurator');
508

    
509
$form->add($section);
510

    
511
$section = new Form_Section('webConfigurator');
512

    
513
gen_webguicss_field($section, $pconfig['webguicss']);
514
gen_webguifixedmenu_field($section, $pconfig['webguifixedmenu']);
515
gen_webguihostnamemenu_field($section, $pconfig['webguihostnamemenu']);
516
gen_dashboardcolumns_field($section, $pconfig['dashboardcolumns']);
517
gen_associatedpanels_fields(
518
	$section,
519
	$pconfig['dashboardavailablewidgetspanel'],
520
	$pconfig['systemlogsfilterpanel'],
521
	$pconfig['systemlogsmanagelogpanel'],
522
	$pconfig['statusmonitoringsettingspanel']);
523
gen_webguileftcolumnhyper_field($section, $pconfig['webguileftcolumnhyper']);
524

    
525
$section->addInput(new Form_Checkbox(
526
	'loginshowhost',
527
	'Login hostname',
528
	'Show hostname on login banner',
529
	$pconfig['loginshowhost']
530
));
531

    
532
$section->addInput(new Form_Input(
533
	'dashboardperiod',
534
	'Dashboard update period',
535
	'number',
536
	$pconfig['dashboardperiod'],
537
	['min' => '5', 'max' => '600']
538
))->setHelp('Time in seconds between dashboard widget updates. Small values cause ' .
539
			'more frequent updates but increase the load on the web server. ' .
540
			'Minimum is 5 seconds, maximum 600 seconds');
541

    
542
$form->add($section);
543

    
544
print $form;
545

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

    
548
?>
549
</div>
550

    
551
<script>
552
//<![CDATA[
553
events.push(function() {
554

    
555
	function setThemeWarning() {
556
		if ($('#webguicss').val().startsWith("pfSense")) {
557
			$('#csstxt').html("").addClass("text-default");
558
		} else {
559
			$('#csstxt').html("<?=$csswarning?>").addClass("text-danger");
560
		}
561
	}
562

    
563
	$('#webguicss').change(function() {
564
		setThemeWarning();
565
	});
566

    
567
	setThemeWarning();
568
});
569
//]]>
570
</script>
571

    
572
<?php
573
include("foot.inc");
574
?>
(186-186/227)