Project

General

Profile

Download (19.7 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

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

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

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

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

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

    
126
$timezonelist = system_get_timezone_list();
127

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

    
136
if ($_POST) {
137

    
138
	$changecount++;
139

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

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

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

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

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

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

    
165
	if ($_POST['webguihostnamemenu']) {
166
		$config['system']['webgui']['webguihostnamemenu'] = $_POST['webguihostnamemenu'];
167
	} else {
168
		unset($config['system']['webgui']['webguihostnamemenu']);
169
	}
170

    
171
	if ($_POST['dashboardcolumns']) {
172
		$config['system']['webgui']['dashboardcolumns'] = $_POST['dashboardcolumns'];
173
	} else {
174
		unset($config['system']['webgui']['dashboardcolumns']);
175
	}
176

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

    
190
	$dnslist = $ignore_posted_dnsgw = array();
191

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

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

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

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

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

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

    
251
		if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
252
			$config['system']['language'] = $_POST['language'];
253
			set_language();
254
		}
255

    
256
		unset($config['system']['webgui']['webguileftcolumnhyper']);
257
		$config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
258

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

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

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

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

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

    
287
		$olddnsallowoverride = $config['system']['dnsallowoverride'];
288

    
289
		unset($config['system']['dnsallowoverride']);
290
		$config['system']['dnsallowoverride'] = $_POST['dnsallowoverride'] ? true : false;
291

    
292
		if ($_POST['dnslocalhost'] == "yes") {
293
			$config['system']['dnslocalhost'] = true;
294
		} else {
295
			unset($config['system']['dnslocalhost']);
296
		}
297

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

    
305
			if ($ignore_posted_dnsgw[$dnsgwname]) {
306
				$thisdnsgwname = "none";
307
			} else {
308
				$thisdnsgwname = $pconfig[$dnsgwname];
309
			}
310

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

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

    
344
		if ($changecount > 0) {
345
			write_config($changedesc);
346
		}
347

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

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

    
364
		// Reload the filter - plugins might need to be run.
365
		$retval |= filter_configure();
366

    
367
		$savemsg = get_std_save_message($retval);
368
	}
369

    
370
	unset($ignore_posted_dnsgw);
371
}
372

    
373
$pgtitle = array(gettext("System"), gettext("General Setup"));
374
include("head.inc");
375

    
376
if ($input_errors) {
377
	print_input_errors($input_errors);
378
}
379

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

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

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

    
407
$form->add($section);
408

    
409
$section = new Form_Section('DNS Server Settings');
410

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

    
415
	$group = new Form_Group('DNS Server ' . $i);
416

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

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

    
427
	if ($multiwan)	{
428
		$options = array('none' => 'none');
429

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

    
435
			if ((is_ipaddrv6(lookup_gateway_ip_by_name($pconfig[$dnsgw])) && (is_ipaddrv4($gwitem['gateway'])))) {
436
				continue;
437
			}
438

    
439
			$options[$gwname] = $gwname.' - '.$gwitem['friendlyiface'].' - '.$gwitem['gateway'];
440
		}
441

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

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

    
453
	if ($i == 4) {
454
		$group->setHelp($help);
455
	}
456

    
457
	$section->add($group);
458
}
459

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

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

    
480
$form->add($section);
481

    
482
$section = new Form_Section('Localization');
483

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

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

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

    
506
$form->add($section);
507

    
508
$section = new Form_Section('webConfigurator');
509

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

    
522
$section->addInput(new Form_Input(
523
	'dashboardperiod',
524
	'Dashboard update period',
525
	'number',
526
	$pconfig['dashboardperiod'],
527
	['min' => '5', 'max' => '600']
528
))->setHelp('Time in seconds between dashboard widget updates. Small values cause ' .
529
			'more frequent updates but increase the load on the web server. ' .
530
			'Minimum is 5 seconds, maximum 600 seconds');
531

    
532
$form->add($section);
533

    
534
print $form;
535

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

    
538
?>
539
</div>
540

    
541
<script>
542
//<![CDATA[
543
events.push(function() {
544

    
545
	function setThemeWarning() {
546
		if ($('#webguicss').val().startsWith("pfSense")) {
547
			$('#csstxt').html("").addClass("text-default");
548
		} else {
549
			$('#csstxt').html("<?=$csswarning?>").addClass("text-danger");
550
		}
551
	}
552

    
553
	$('#webguicss').change(function() {
554
		setThemeWarning();
555
	});
556

    
557
	setThemeWarning();
558
});
559
//]]>
560
</script>
561

    
562
<?php
563
include("foot.inc");
564
?>
(186-186/227)