Project

General

Profile

Download (27.7 KB) Statistics
| Branch: | Tag: | Revision:

univnautes / usr / local / www / system_advanced_admin.php @ a1b66bec

1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_admin.php
5
	part of pfSense
6
	Copyright (C) 2005-2010 Scott Ullrich
7

    
8
	Copyright (C) 2008 Shrew Soft Inc
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['loginautocomplete'] = isset($config['system']['webgui']['loginautocomplete']);
63
$pconfig['althostnames'] = $config['system']['webgui']['althostnames'];
64
$pconfig['enableserial'] = $config['system']['enableserial'];
65
$pconfig['serialspeed'] = $config['system']['serialspeed'];
66
$pconfig['primaryconsole'] = $config['system']['primaryconsole'];
67
$pconfig['enablesshd'] = $config['system']['enablesshd'];
68
$pconfig['sshport'] = $config['system']['ssh']['port'];
69
$pconfig['sshdkeyonly'] = isset($config['system']['ssh']['sshdkeyonly']);
70
$pconfig['quietlogin'] = isset($config['system']['webgui']['quietlogin']);
71

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

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

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

    
81
if ($_POST) {
82

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

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

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

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

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

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

    
111
	ob_flush();
112
	flush();
113

    
114
	if (!$input_errors) {
115

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

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

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

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

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

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

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

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

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

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

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

    
183
		if ($_POST['althostnames'])
184
			$config['system']['webgui']['althostnames'] = $_POST['althostnames'];
185
		else
186
			unset($config['system']['webgui']['althostnames']);
187

    
188
		$sshd_enabled = $config['system']['enablesshd'];
189
		if($_POST['enablesshd'])
190
			$config['system']['enablesshd'] = "enabled";
191
		else
192
			unset($config['system']['enablesshd']);
193

    
194
		$sshd_keyonly = isset($config['system']['sshdkeyonly']);
195
		if ($_POST['sshdkeyonly'])
196
			$config['system']['sshdkeyonly'] = true;
197
		else
198
			unset($config['system']['sshdkeyonly']);
199

    
200
		$sshd_port = $config['system']['ssh']['port'];
201
		if ($_POST['sshport'])
202
			$config['system']['ssh']['port'] = $_POST['sshport'];
203
		else if (isset($config['system']['ssh']['port']))
204
			unset($config['system']['ssh']['port']);
205

    
206
		if (($sshd_enabled != $config['system']['enablesshd']) ||
207
			($sshd_keyonly != $config['system']['sshdkeyonly']) ||
208
			($sshd_port != $config['system']['ssh']['port']))
209
			$restart_sshd = true;
210

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

    
235
		write_config();
236

    
237
		$retval = filter_configure();
238
	    $savemsg = get_std_save_message($retval);
239

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

    
243
		conf_mount_rw();
244
		setup_serial_port();
245
		// Restart DNS in case dns rebinding toggled
246
		if (isset($config['dnsmasq']['enable']))
247
			services_dnsmasq_configure();
248
		elseif (isset($config['unbound']['enable']))
249
			services_unbound_configure();
250
		conf_mount_ro();
251
	}
252
}
253

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

    
269
$pgtitle = array(gettext("System"),gettext("Advanced: Admin Access"));
270
include("head.inc");
271

    
272
?>
273

    
274
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
275
<?php include("fbegin.inc"); ?>
276
<script type="text/javascript">
277
//<![CDATA[
278

    
279
function prot_change() {
280

    
281
	if (document.iform.https_proto.checked)
282
		document.getElementById("ssl_opts").style.display="";
283
	else
284
		document.getElementById("ssl_opts").style.display="none";
285
}
286

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

    
611
<?php include("fend.inc"); ?>
612
<?php
613
	if ($restart_webgui)
614
		echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
615
?>
616
</body>
617
</html>
618

    
619
<?php
620
if ($restart_sshd) {
621

    
622
	killbyname("sshd");
623
	log_error(gettext("secure shell configuration has changed. Stopping sshd."));
624

    
625
	if ($config['system']['enablesshd']) {
626
		log_error(gettext("secure shell configuration has changed. Restarting sshd."));
627
		send_event("service restart sshd");
628
	}
629
}
630
if ($restart_webgui) {
631
	ob_flush();
632
	flush();
633
	log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
634
	send_event("service restart webgui");
635
}
636

    
637
?>
(205-205/256)