Project

General

Profile

Download (28.5 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_admin.php
5
	part of pfSense
6
	Copyright (C) 2005-2010 Scott Ullrich
7
	Copyright (C) 2008 Shrew Soft Inc
8
	Copyright (C) 2013-2015 Electric Sheep Fencing, LP
9

    
10
	originally part of m0n0wall (http://m0n0.ch/wall)
11
	Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
12
	All rights reserved.
13

    
14
	Redistribution and use in source and binary forms, with or without
15
	modification, are permitted provided that the following conditions are met:
16

    
17
	1. Redistributions of source code must retain the above copyright notice,
18
	   this list of conditions and the following disclaimer.
19

    
20
	2. Redistributions in binary form must reproduce the above copyright
21
	   notice, this list of conditions and the following disclaimer in the
22
	   documentation and/or other materials provided with the distribution.
23

    
24
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
25
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
26
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
28
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33
	POSSIBILITY OF SUCH DAMAGE.
34
*/
35
/*
36
	pfSense_BUILDER_BINARIES:	/usr/bin/killall
37
	pfSense_MODULE:	system
38
*/
39

    
40
##|+PRIV
41
##|*IDENT=page-system-advanced-admin
42
##|*NAME=System: Advanced: Admin Access Page
43
##|*DESCR=Allow access to the 'System: Advanced: Admin Access' page.
44
##|*MATCH=system_advanced_admin.php*
45
##|-PRIV
46

    
47
require("guiconfig.inc");
48
require_once("functions.inc");
49
require_once("filter.inc");
50
require_once("shaper.inc");
51

    
52
$pconfig['webguiproto'] = $config['system']['webgui']['protocol'];
53
$pconfig['webguiport'] = $config['system']['webgui']['port'];
54
$pconfig['max_procs'] = ($config['system']['webgui']['max_procs']) ? $config['system']['webgui']['max_procs'] : 2;
55
$pconfig['ssl-certref'] = $config['system']['webgui']['ssl-certref'];
56
$pconfig['disablehttpredirect'] = isset($config['system']['webgui']['disablehttpredirect']);
57
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
58
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
59
$pconfig['nodnsrebindcheck'] = isset($config['system']['webgui']['nodnsrebindcheck']);
60
$pconfig['nohttpreferercheck'] = isset($config['system']['webgui']['nohttpreferercheck']);
61
$pconfig['beast_protection'] = isset($config['system']['webgui']['beast_protection']);
62
$pconfig['pagenamefirst'] = isset($config['system']['webgui']['pagenamefirst']);
63
$pconfig['loginautocomplete'] = isset($config['system']['webgui']['loginautocomplete']);
64
$pconfig['althostnames'] = $config['system']['webgui']['althostnames'];
65
$pconfig['enableserial'] = $config['system']['enableserial'];
66
$pconfig['serialspeed'] = $config['system']['serialspeed'];
67
$pconfig['primaryconsole'] = $config['system']['primaryconsole'];
68
$pconfig['enablesshd'] = $config['system']['enablesshd'];
69
$pconfig['sshport'] = $config['system']['ssh']['port'];
70
$pconfig['sshdkeyonly'] = isset($config['system']['ssh']['sshdkeyonly']);
71
$pconfig['quietlogin'] = isset($config['system']['webgui']['quietlogin']);
72

    
73
$a_cert =& $config['cert'];
74

    
75
$certs_available = false;
76
if (is_array($a_cert) && count($a_cert))
77
	$certs_available = true;
78

    
79
if (!$pconfig['webguiproto'] || !$certs_available)
80
	$pconfig['webguiproto'] = "http";
81

    
82
if ($_POST) {
83

    
84
	unset($input_errors);
85
	$pconfig = $_POST;
86

    
87
	/* input validation */
88
	if ($_POST['webguiport'])
89
		if(!is_port($_POST['webguiport']))
90
			$input_errors[] = gettext("You must specify a valid webConfigurator port number");
91

    
92
	if ($_POST['max_procs'])
93
		if(!is_numericint($_POST['max_procs']) || ($_POST['max_procs'] < 1) || ($_POST['max_procs'] > 500))
94
			$input_errors[] = gettext("Max Processes must be a number 1 or greater");
95

    
96
	if ($_POST['althostnames']) {
97
		$althosts = explode(" ", $_POST['althostnames']);
98
		foreach ($althosts as $ah)
99
			if (!is_hostname($ah))
100
				$input_errors[] = sprintf(gettext("Alternate hostname %s is not a valid hostname."),htmlspecialchars($ah));
101
	}
102

    
103
	if ($_POST['sshport'])
104
		if(!is_port($_POST['sshport']))
105
			$input_errors[] = gettext("You must specify a valid port number");
106

    
107
	if($_POST['sshdkeyonly'] == "yes")
108
		$config['system']['ssh']['sshdkeyonly'] = "enabled";
109
	else if (isset($config['system']['ssh']['sshdkeyonly']))
110
		unset($config['system']['ssh']['sshdkeyonly']);
111

    
112
	ob_flush();
113
	flush();
114

    
115
	if (!$input_errors) {
116

    
117
		if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto']))
118
			$restart_webgui = true;
119
		if (update_if_changed("webgui port", $config['system']['webgui']['port'], $_POST['webguiport']))
120
			$restart_webgui = true;
121
		if (update_if_changed("webgui certificate", $config['system']['webgui']['ssl-certref'], $_POST['ssl-certref']))
122
			$restart_webgui = true;
123
		if (update_if_changed("webgui max processes", $config['system']['webgui']['max_procs'], $_POST['max_procs']))
124
			$restart_webgui = true;
125

    
126
		if ($_POST['disablehttpredirect'] == "yes") {
127
			$config['system']['webgui']['disablehttpredirect'] = true;
128
			$restart_webgui = true;
129
		} else {
130
			unset($config['system']['webgui']['disablehttpredirect']);
131
			$restart_webgui = true;
132
		}
133
		if ($_POST['quietlogin'] == "yes") {
134
			$config['system']['webgui']['quietlogin'] = true;
135
		} else {
136
			unset($config['system']['webgui']['quietlogin']);
137
		}
138

    
139
		if($_POST['disableconsolemenu'] == "yes")
140
			$config['system']['disableconsolemenu'] = true;
141
		else
142
			unset($config['system']['disableconsolemenu']);
143

    
144
		if ($_POST['noantilockout'] == "yes")
145
			$config['system']['webgui']['noantilockout'] = true;
146
		else
147
			unset($config['system']['webgui']['noantilockout']);
148

    
149
		if ($_POST['enableserial'] == "yes" || $g['enableserial_force'])
150
			$config['system']['enableserial'] = true;
151
		else
152
			unset($config['system']['enableserial']);
153

    
154
		if (is_numericint($_POST['serialspeed']))
155
			$config['system']['serialspeed'] = $_POST['serialspeed'];
156
		else
157
			unset($config['system']['serialspeed']);
158

    
159
		if ($_POST['primaryconsole'])
160
			$config['system']['primaryconsole'] = $_POST['primaryconsole'];
161
		else
162
			unset($config['system']['primaryconsole']);
163

    
164
		if ($_POST['nodnsrebindcheck'] == "yes")
165
			$config['system']['webgui']['nodnsrebindcheck'] = true;
166
		else
167
			unset($config['system']['webgui']['nodnsrebindcheck']);
168

    
169
		if ($_POST['nohttpreferercheck'] == "yes")
170
			$config['system']['webgui']['nohttpreferercheck'] = true;
171
		else
172
			unset($config['system']['webgui']['nohttpreferercheck']);
173

    
174
		if ($_POST['beast_protection'] == "yes")
175
			$config['system']['webgui']['beast_protection'] = true;
176
		else
177
			unset($config['system']['webgui']['beast_protection']);
178

    
179
		if ($_POST['pagenamefirst'] == "yes")
180
			$config['system']['webgui']['pagenamefirst'] = true;
181
		else
182
			unset($config['system']['webgui']['pagenamefirst']);
183

    
184
		if ($_POST['loginautocomplete'] == "yes")
185
			$config['system']['webgui']['loginautocomplete'] = true;
186
		else
187
			unset($config['system']['webgui']['loginautocomplete']);
188

    
189
		if ($_POST['althostnames'])
190
			$config['system']['webgui']['althostnames'] = $_POST['althostnames'];
191
		else
192
			unset($config['system']['webgui']['althostnames']);
193

    
194
		$sshd_enabled = $config['system']['enablesshd'];
195
		if($_POST['enablesshd'])
196
			$config['system']['enablesshd'] = "enabled";
197
		else
198
			unset($config['system']['enablesshd']);
199

    
200
		$sshd_keyonly = isset($config['system']['sshdkeyonly']);
201
		if ($_POST['sshdkeyonly'])
202
			$config['system']['sshdkeyonly'] = true;
203
		else
204
			unset($config['system']['sshdkeyonly']);
205

    
206
		$sshd_port = $config['system']['ssh']['port'];
207
		if ($_POST['sshport'])
208
			$config['system']['ssh']['port'] = $_POST['sshport'];
209
		else if (isset($config['system']['ssh']['port']))
210
			unset($config['system']['ssh']['port']);
211

    
212
		if (($sshd_enabled != $config['system']['enablesshd']) ||
213
			($sshd_keyonly != $config['system']['sshdkeyonly']) ||
214
			($sshd_port != $config['system']['ssh']['port']))
215
			$restart_sshd = true;
216

    
217
		if ($restart_webgui) {
218
			global $_SERVER;
219
			$http_host_port = explode("]", $_SERVER['HTTP_HOST']);
220
			/* IPv6 address check */
221
			if(strstr($_SERVER['HTTP_HOST'], "]")) {
222
				if(count($http_host_port) > 1) {
223
					array_pop($http_host_port);
224
					$host = str_replace(array("[", "]"), "", implode(":", $http_host_port));
225
					$host = "[{$host}]";
226
				} else {
227
					$host = str_replace(array("[", "]"), "", implode(":", $http_host_port));
228
					$host = "[{$host}]";
229
				}
230
			} else {
231
				list($host) = explode(":", $_SERVER['HTTP_HOST']);
232
			}
233
			$prot = $config['system']['webgui']['protocol'];
234
			$port = $config['system']['webgui']['port'];
235
			if ($port)
236
				$url = "{$prot}://{$host}:{$port}/system_advanced_admin.php";
237
			else
238
				$url = "{$prot}://{$host}/system_advanced_admin.php";
239
		}
240

    
241
		write_config();
242

    
243
		$retval = filter_configure();
244
	    $savemsg = get_std_save_message($retval);
245

    
246
		if ($restart_webgui)
247
			$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."),$url);
248

    
249
		conf_mount_rw();
250
		setup_serial_port();
251
		// Restart DNS in case dns rebinding toggled
252
		if (isset($config['dnsmasq']['enable']))
253
			services_dnsmasq_configure();
254
		elseif (isset($config['unbound']['enable']))
255
			services_unbound_configure();
256
		conf_mount_ro();
257
	}
258
}
259

    
260
unset($hwcrypto);
261
$fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r");
262
if ($fd) {
263
	while (!feof($fd)) {
264
		$dmesgl = fgets($fd);
265
		if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) {
266
				unset($pconfig['beast_protection']);
267
				$disable_beast_option = "disabled";
268
				$hwcrypto = $matches[1];
269
			break;
270
		}
271
	}
272
	fclose($fd);
273
}
274

    
275
$pgtitle = array(gettext("System"),gettext("Advanced: Admin Access"));
276
include("head.inc");
277

    
278
?>
279

    
280
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
281
<?php include("fbegin.inc"); ?>
282
<script type="text/javascript">
283
//<![CDATA[
284

    
285
function prot_change() {
286

    
287
	if (document.iform.https_proto.checked)
288
		document.getElementById("ssl_opts").style.display="";
289
	else
290
		document.getElementById("ssl_opts").style.display="none";
291
}
292

    
293
//]]>
294
</script>
295
<?php
296
	if ($input_errors)
297
		print_input_errors($input_errors);
298
	if ($savemsg)
299
		print_info_box($savemsg);
300
?>
301
	<form action="system_advanced_admin.php" method="post" name="iform" id="iform">
302
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced admin">
303
			<tr>
304
				<td>
305
					<?php
306
						$tab_array = array();
307
						$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
308
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
309
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
310
						$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
311
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
312
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
313
						display_top_tabs($tab_array);
314
					?>
315
				</td>
316
			</tr>
317
			<tr>
318
				<td id="mainarea">
319
					<div class="tabcont">
320
						<span class="vexpl">
321
							<span class="red">
322
								<strong><?=gettext("NOTE:"); ?>&nbsp;</strong>
323
							</span>
324
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
325
							<br />
326
						</span>
327
						<br />
328
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
329
							<tr>
330
								<td colspan="2" valign="top" class="listtopic"><?=gettext("webConfigurator"); ?></td>
331
							</tr>
332
							<tr>
333
								<td width="22%" valign="top" class="vncell"><?=gettext("Protocol"); ?></td>
334
								<td width="78%" class="vtable">
335
									<?php
336
										if ($pconfig['webguiproto'] == "http")
337
											$http_chk = "checked=\"checked\"";
338
										if ($pconfig['webguiproto'] == "https")
339
											$https_chk = "checked=\"checked\"";
340
										if (!$certs_available)
341
											$https_disabled = "disabled=\"disabled\"";
342
									?>
343
									<input name="webguiproto" id="http_proto" type="radio" value="http" <?=$http_chk;?> onclick="prot_change()" />
344
									<?=gettext("HTTP"); ?>
345
									&nbsp;&nbsp;&nbsp;
346
									<input name="webguiproto" id="https_proto" type="radio" value="https" <?=$https_chk;?> <?=$https_disabled;?> onclick="prot_change()" />
347
									<?=gettext("HTTPS"); ?>
348
									<?php if (!$certs_available): ?>
349
									<br />
350
									<?=gettext("No Certificates have been defined. You must"); ?>
351
									<a href="system_certmanager.php"><?=gettext("Create or Import"); ?></a>
352
									<?=gettext("a Certificate before SSL can be enabled."); ?>
353
									<?php endif; ?>
354
								</td>
355
							</tr>
356
							<tr id="ssl_opts">
357
								<td width="22%" valign="top" class="vncell"><?=gettext("SSL Certificate"); ?></td>
358
								<td width="78%" class="vtable">
359
									<select name="ssl-certref" id="ssl-certref" class="formselect">
360
										<?php
361
											foreach($a_cert as $cert):
362
												$selected = "";
363
												if ($pconfig['ssl-certref'] == $cert['refid'])
364
													$selected = "selected=\"selected\"";
365
										?>
366
										<option value="<?=$cert['refid'];?>" <?=$selected;?>><?=$cert['descr'];?></option>
367
										<?php
368
										endforeach;
369
										if (!count($a_cert))
370
											echo "<option></option>";
371
										?>
372
									</select>
373
								</td>
374
							</tr>
375
							<tr>
376
								<td valign="top" class="vncell"><?=gettext("TCP port"); ?></td>
377
								<td class="vtable">
378
									<input name="webguiport" type="text" class="formfld unknown" id="webguiport" size="5" value="<?=htmlspecialchars($config['system']['webgui']['port']);?>" />
379
									<br />
380
									<span class="vexpl">
381
										<?=gettext("Enter a custom port number for the webConfigurator " .
382
										"above if you want to override the default (80 for HTTP, 443 " .
383
										"for HTTPS). Changes will take effect immediately after save."); ?>
384
									</span>
385
								</td>
386
							</tr>
387
							<tr>
388
								<td valign="top" class="vncell"><?=gettext("Max Processes"); ?></td>
389
								<td class="vtable">
390
									<input name="max_procs" type="text" class="formfld unknown" id="max_procs" size="5" value="<?=htmlspecialchars($pconfig['max_procs']);?>" />
391
									<br />
392
									<span class="vexpl">
393
										<?=gettext("Enter the number of webConfigurator processes you " .
394
										"want to run. This defaults to 2. Increasing this will allow more " .
395
										"users/browsers to access the GUI concurrently."); ?>
396
									</span>
397
								</td>
398
							</tr>
399
							<tr>
400
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI redirect"); ?></td>
401
								<td width="78%" class="vtable">
402
									<input name="disablehttpredirect" type="checkbox" id="disablehttpredirect" value="yes" <?php if ($pconfig['disablehttpredirect']) echo "checked=\"checked\""; ?> />
403
									<strong><?=gettext("Disable webConfigurator redirect rule"); ?></strong>
404
									<br />
405
									<?php echo gettext("When this is unchecked, access to the webConfigurator " .
406
									"is always permitted even on port 80, regardless of the listening port configured. " .
407
									"Check this box to disable this automatically added redirect rule. ");
408
									?>
409
								</td>
410
							</tr>
411
							<tr>
412
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI Login Autocomplete"); ?></td>
413
								<td width="78%" class="vtable">
414
									<input name="loginautocomplete" type="checkbox" id="loginautocomplete" value="yes" <?php if ($pconfig['loginautocomplete']) echo "checked=\"checked\""; ?> />
415
									<strong><?=gettext("Enable webConfigurator login autocomplete"); ?></strong>
416
									<br />
417
									<?php echo gettext("When this is checked, login credentials for the webConfigurator " .
418
									"may be saved by the browser. While convenient, some security standards require this to be disabled. " .
419
									"Check this box to enable autocomplete on the login form so that browsers will prompt to save credentials (NOTE: Some browsers do not respect this option). ");
420
									?>
421
								</td>
422
							</tr>
423
							<tr>
424
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI login messages"); ?></td>
425
								<td width="78%" class="vtable">
426
									<input name="quietlogin" type="checkbox" id="quietlogin" value="yes" <?php if ($pconfig['quietlogin']) echo "checked=\"checked\""; ?> />
427
									<strong><?=gettext("Disable logging of webConfigurator successful logins"); ?></strong>
428
									<br />
429
									<?php echo gettext("When this is checked, successful logins to the webConfigurator " .
430
									"will not be logged.");
431
									?>
432
								</td>
433
							</tr>
434
							<tr>
435
								<td width="22%" valign="top" class="vncell"><?=gettext("Anti-lockout"); ?></td>
436
								<td width="78%" class="vtable">
437
									<?php
438
										if($config['interfaces']['lan']) 
439
											$lockout_interface = "LAN";
440
										else 
441
											$lockout_interface = "WAN";
442
									?>
443
									<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked=\"checked\""; ?> />
444
									<strong><?=gettext("Disable webConfigurator anti-lockout rule"); ?></strong>
445
									<br />
446
									<?php printf(gettext("When this is unchecked, access to the webConfigurator " .
447
									"on the %s interface is always permitted, regardless of the user-defined firewall " .
448
									"rule set. Check this box to disable this automatically added rule, so access " .
449
									"to the webConfigurator is controlled by the user-defined firewall rules " .
450
									"(ensure you have a firewall rule in place that allows you in, or you will " .
451
									"lock yourself out!)"), $lockout_interface); ?>
452
									<em> <?=gettext("Hint: the &quot;Set interface(s) IP address&quot; option in the console menu resets this setting as well."); ?> </em>
453
								</td>
454
							</tr>
455
							<tr>
456
								<td width="22%" valign="top" class="vncell"><?=gettext("DNS Rebind Check"); ?></td>
457
								<td width="78%" class="vtable">
458
									<input name="nodnsrebindcheck" type="checkbox" id="nodnsrebindcheck" value="yes" <?php if ($pconfig['nodnsrebindcheck']) echo "checked=\"checked\""; ?> />
459
									<strong><?=gettext("Disable DNS Rebinding Checks"); ?></strong>
460
									<br />
461
									<?php echo gettext("When this is unchecked, your system " .
462
									"is protected against <a href=\"http://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding attacks</a>. " .
463
									"This blocks private IP responses from your configured DNS servers. Check this box to disable this protection if it interferes with " .
464
									"webConfigurator access or name resolution in your environment. "); ?>
465
								</td>
466
							</tr>
467
							<tr>
468
								<td width="22%" valign="top" class="vncell"><?=gettext("Alternate Hostnames"); ?></td>
469
								<td width="78%" class="vtable">
470
									<input name="althostnames" type="text" class="formfld unknown" id="althostnames" size="75" value="<?=htmlspecialchars($pconfig['althostnames']);?>"/>
471
									<br />
472
									<strong><?=gettext("Alternate Hostnames for DNS Rebinding and HTTP_REFERER Checks"); ?></strong>
473
									<br />
474
									<?php echo gettext("Here you can specify alternate hostnames by which the router may be queried, to " . 
475
									"bypass the DNS Rebinding Attack checks. Separate hostnames with spaces."); ?>
476
								</td>
477
							</tr>
478
							<tr>
479
								<td width="22%" valign="top" class="vncell"><?=gettext("Browser HTTP_REFERER enforcement"); ?></td>
480
								<td width="78%" class="vtable">
481
									<input name="nohttpreferercheck" type="checkbox" id="nohttpreferercheck" value="yes" <?php if ($pconfig['nohttpreferercheck']) echo "checked=\"checked\""; ?> />
482
									<strong><?=gettext("Disable HTTP_REFERER enforcement check"); ?></strong>
483
									<br />
484
									<?php echo gettext("When this is unchecked, access to the webConfigurator " .
485
									"is protected against HTTP_REFERER redirection attempts. " .
486
									"Check this box to disable this protection if you find that it interferes with " .
487
									"webConfigurator access in certain corner cases such as using external scripts to interact with this system. More information on HTTP_REFERER is available from <a target='_blank' href='http://en.wikipedia.org/wiki/HTTP_referrer'>Wikipedia</a>."); ?>
488
								</td>
489
							</tr>
490
							<tr>
491
								<td width="22%" valign="top" class="vncell"><?=gettext("BEAST Attack Protection"); ?></td>
492
								<td width="78%" class="vtable">
493
									<input name="beast_protection" type="checkbox" id="beast_protection" value="yes" <?php if ($pconfig['beast_protection']) echo "checked=\"checked\""; ?> <?= $disable_beast_option ?>/>
494
									<strong><?=gettext("Mitigate the BEAST SSL Attack"); ?></strong>
495
									<br />
496
									<?php echo gettext("When this is checked, the webConfigurator can mitigate BEAST SSL attacks. ") ?>
497
									<br />
498
									<?php 	if ($disable_beast_option) {
499
											echo "<br />" . sprintf(gettext("This option has been automatically disabled because a conflicting cryptographic accelerator card has been detected (%s)."), $hwcrypto) . "<br /><br />";
500
										} ?>
501
									<?php echo gettext("This option is off by default because Hifn accelerators do NOT work with this option, and the GUI will not function. " .
502
									"It is possible that other accelerators have a similar problem that is not yet known/documented. " .
503
									"More information on BEAST is available from <a target='_blank' href='https://en.wikipedia.org/wiki/Transport_Layer_Security#BEAST_attack'>Wikipedia</a>."); ?>
504
								</td>
505
							</tr>
506
							<tr>
507
								<td width="22%" valign="top" class="vncell"><?=gettext("Browser tab text"); ?></td>
508
								<td width="78%" class="vtable">
509
									<input name="pagenamefirst" type="checkbox" id="pagenamefirst" value="yes" <?php if ($pconfig['pagenamefirst']) echo "checked=\"checked\""; ?> />
510
									<strong><?=gettext("Display page name first in browser tab"); ?></strong>
511
									<br />
512
									<?php echo gettext("When this is unchecked, the browser tab shows the host name followed by the current page. "); ?>
513
									<br />
514
									<?php echo gettext("Check this box to display the current page followed by the host name."); ?>
515
								</td>
516
							</tr>
517
							<tr>
518
								<td colspan="2" class="list" height="12">&nbsp;</td>
519
							</tr>
520
							<tr>
521
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Secure Shell"); ?></td>
522
							</tr>
523
							<tr>
524
								<td width="22%" valign="top" class="vncell"><?=gettext("Secure Shell Server"); ?></td>
525
								<td width="78%" class="vtable">
526
									<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked=\"checked\""; ?> />
527
									<strong><?=gettext("Enable Secure Shell"); ?></strong>
528
								</td>
529
							</tr>
530
							<tr>
531
								<td width="22%" valign="top" class="vncell"><?=gettext("Authentication Method"); ?></td>
532
								<td width="78%" class="vtable">
533
									<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if ($pconfig['sshdkeyonly']) echo "checked=\"checked\""; ?> />
534
									<strong><?=gettext("Disable password login for Secure Shell (RSA/DSA key only)"); ?></strong>
535
									<br />
536
									<?=gettext("When enabled, authorized keys need to be configured for each"); ?>
537
									<a href="system_usermanager.php"><?=gettext("user"); ?></a>
538
									<?=gettext("that has been granted secure shell access."); ?>
539
								</td>
540
							</tr>
541
							<tr>
542
								<td width="22%" valign="top" class="vncell"><?=gettext("SSH port"); ?></td>
543
								<td width="78%" class="vtable">
544
									<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" />
545
									<br />
546
									<span class="vexpl"><?=gettext("Note: Leave this blank for the default of 22."); ?></span>
547
								</td>
548
							</tr>
549
							<tr>
550
								<td colspan="2" class="list" height="12">&nbsp;</td>
551
							</tr>
552
							<tr>
553
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Serial Communications"); ?></td>
554
							</tr>
555
							<?php if (!$g['enableserial_force'] && ($g['platform'] == "pfSense" || $g['platform'] == "cdrom" || file_exists("/etc/nano_use_vga.txt"))): ?>
556
							<tr>
557
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Terminal"); ?></td>
558
								<td width="78%" class="vtable">
559
									<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked=\"checked\""; ?> />
560
									<strong><?=gettext("Enables the first serial port with 115200/8/N/1 by default, or another speed selectable below."); ?></strong>
561
									<span class="vexpl"><?=gettext("Note:  This will redirect the console output and messages to the serial port. You can still access the console menu from the internal video card/keyboard. A <b>null modem</b> serial cable or adapter is required to use the serial console."); ?></span>
562
								</td>
563
							</tr>
564
							<?php endif; ?>
565
							<tr>
566
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Speed")?></td>
567
								<td width="78%" class="vtable">
568
									<select name="serialspeed" id="serialspeed" class="formselect">
569
										<option value="115200" <?php if ($pconfig['serialspeed'] == "115200") echo "selected=\"selected\"";?>>115200</option>
570
										<option value="57600"  <?php if ($pconfig['serialspeed'] == "57600")  echo "selected=\"selected\"";?>>57600</option>
571
										<option value="38400"  <?php if ($pconfig['serialspeed'] == "38400")  echo "selected=\"selected\"";?>>38400</option>
572
										<option value="19200"  <?php if ($pconfig['serialspeed'] == "19200")  echo "selected=\"selected\"";?>>19200</option>
573
										<option value="14400"  <?php if ($pconfig['serialspeed'] == "14400")  echo "selected=\"selected\"";?>>14400</option>
574
										<option value="9600"   <?php if ($pconfig['serialspeed'] == "9600")   echo "selected=\"selected\"";?>>9600</option>
575
									</select> bps
576
									<br /><?=gettext("Allows selection of different speeds for the serial console port."); ?>
577
								</td>
578
							</tr>
579
							<?php if (!$g['primaryconsole_force'] && ($g['platform'] == "pfSense" || $g['platform'] == "cdrom" || file_exists("/etc/nano_use_vga.txt"))): ?>
580
							<tr>
581
								<td width="22%" valign="top" class="vncell"><?=gettext("Primary Console")?></td>
582
								<td width="78%" class="vtable">
583
									<select name="primaryconsole" id="primaryconsole" class="formselect">
584
										<option value="serial"   <?php if ($pconfig['primaryconsole'] == "serial")   echo "selected=\"selected\"";?>>Serial Console</option>
585
										<option value="video"  <?php if ($pconfig['primaryconsole'] == "video")  echo "selected=\"selected\"";?>>VGA Console</option>
586
									</select>
587
									<br /><?=gettext("Select the preferred console if multiple consoles are present. The preferred console will show pfSense boot script output. All consoles display OS boot messages, console messages, and the console menu."); ?>
588
								</td>
589
							</tr>
590
							<?php endif; ?>
591
							<tr>
592
								<td colspan="2" class="list" height="12">&nbsp;</td>
593
							</tr>
594
							<tr>
595
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Console Options"); ?></td>
596
							</tr>
597
							<tr>
598
								<td width="22%" valign="top" class="vncell"><?=gettext("Console menu"); ?></td>
599
								<td width="78%" class="vtable">
600
									<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked=\"checked\""; ?>  />
601
									<strong><?=gettext("Password protect the console menu"); ?></strong>
602
								</td>
603
							</tr>
604
							<tr>
605
								<td colspan="2" class="list" height="12">&nbsp;</td>
606
							</tr>							
607
							<tr>
608
								<td width="22%" valign="top">&nbsp;</td>
609
								<td width="78%"><input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" /></td>
610
							</tr>
611
							<tr>
612
								<td colspan="2" class="list" height="12">&nbsp;</td>
613
							</tr>
614
						</table>
615
					</div>
616
				</td>
617
			</tr>
618
		</table>
619
	</form>
620
	<script type="text/javascript">
621
	//<![CDATA[
622
		prot_change();
623
	//]]>
624
	</script>
625

    
626
<?php include("fend.inc"); ?>
627
<?php
628
	if ($restart_webgui)
629
		echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
630
?>
631
</body>
632
</html>
633

    
634
<?php
635
if ($restart_sshd) {
636

    
637
	killbyname("sshd");
638
	log_error(gettext("secure shell configuration has changed. Stopping sshd."));
639

    
640
	if ($config['system']['enablesshd']) {
641
		log_error(gettext("secure shell configuration has changed. Restarting sshd."));
642
		send_event("service restart sshd");
643
	}
644
}
645
if ($restart_webgui) {
646
	ob_flush();
647
	flush();
648
	log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
649
	send_event("service restart webgui");
650
}
651

    
652
?>
(205-205/256)