Project

General

Profile

« Previous | Next » 

Revision 81dfcea5

Added by Sjon Hortensius over 10 years ago

Converted system_advanced_admin

View differences:

usr/local/www/system_advanced_admin.php
85 85
	$pconfig = $_POST;
86 86

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

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

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

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

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

  
115 115
	if (!$input_errors) {
116 116

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  
......
241 241
		write_config();
242 242

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

  
246 246
		if ($restart_webgui)
247 247
			$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."),$url);
......
264 264
		$dmesgl = fgets($fd);
265 265
		if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches)) {
266 266
				unset($pconfig['beast_protection']);
267
				$disable_beast_option = "disabled";
267
				$disable_beast_option = true;
268 268
				$hwcrypto = $matches[1];
269 269
			break;
270 270
		}
......
275 275
$pgtitle = array(gettext("System"),gettext("Advanced: Admin Access"));
276 276
include("head.inc");
277 277

  
278
?>
279

  
280
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
281
<?php include("fbegin.inc"); ?>
282
<script type="text/javascript">
283
//<![CDATA[
278
if ($input_errors)
279
	print_input_errors($input_errors);
280
if ($savemsg)
281
	print_info_box($savemsg);
282

  
283
$tab_array = array();
284
$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
285
$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
286
$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
287
$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
288
$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
289
$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
290
display_top_tabs($tab_array);
291

  
292
?><div id="container"><?php
293

  
294
require('classes/Form.class.php');
295
$form = new Form;
296
$section = new Form_Section('WebConfigurator');
297
$group = new Form_Group('Protocol');
298

  
299
$group->add(new Form_Checkbox(
300
	'Protocol',
301
	'HTTP',
302
	($pconfig['webguiproto']=='http'),
303
	'http'
304
))->displayAsRadio();
305

  
306
$group->add($input = new Form_Checkbox(
307
	'Protocol',
308
	'HTTPS',
309
	($pconfig['webguiproto']=='https'),
310
	'https'
311
))->displayAsRadio();
312
$section->add($group);
313

  
314
if (!$certs_available)
315
{
316
	$input->setAttribute('disabled', 'disabled');
317
	$input->setHelp('No Certificates have been defined. You must '.
318
	'<a href="system_certmanager.php">'. gettext("Create or Import").'</a> '.
319
	'a Certificate before SSL can be enabled.');
320
} else {
321
	$values = array();
322
	foreach($a_cert as $cert)
323
		$values[ $cert['refid'] ] = $cert['descr'];
324

  
325
	$section->addInput(new Form_Select('SSL Certificate', $pconfig['ssl-certref'], $values));
326
}
284 327

  
285
function prot_change() {
328
$section->addInput(new Form_Input(
329
	'TCP port',
330
	'number',
331
	$config['system']['webgui']['port'],
332
	['min' => 1, 'max' => 65535]
333
))->setHelp('Enter a custom port number for the webConfigurator '.
334
	'above if you want to override the default (80 for HTTP, 443 '.
335
	'for HTTPS). Changes will take effect immediately after save.');
336

  
337
$section->addInput(new Form_Input(
338
	'Max Processes',
339
	'number',
340
	$pconfig['max_procs']
341
))->setHelp('Enter the number of webConfigurator processes you '.
342
	'want to run. This defaults to 2. Increasing this will allow more '.
343
	'users/browsers to access the GUI concurrently.');
344

  
345
$section->addInput(new Form_Checkbox(
346
	'WebGUI redirect',
347
	'Disable webConfigurator redirect rule',
348
	$pconfig['disablehttpredirect']
349
))->setHelp('When this is unchecked, access to the webConfigurator '.
350
	'is always permitted even on port 80, regardless of the listening port configured. '.
351
	'Check this box to disable this automatically added redirect rule.');
352

  
353
$section->addInput(new Form_Checkbox(
354
	'WebGUI Login Autocomplete',
355
	'Enable webConfigurator login autocomplete',
356
	$pconfig['loginautocomplete']
357
))->setHelp('When this is checked, login credentials for the webConfigurator may '.
358
	'be saved by the browser. While convenient, some security standards require this '.
359
	'to be disabled. Check this box to enable autocomplete on the login form so that '.
360
	'browsers will prompt to save credentials (NOTE: Some browsers do not respect '.
361
	'this option).');
362

  
363
$section->addInput(new Form_Checkbox(
364
	'WebGUI login messages',
365
	'Disable logging of webConfigurator successful logins',
366
	$pconfig['quietlogin']
367
))->setHelp('When this is checked, successful logins to the webConfigurator will '.
368
	'not be logged.');
369

  
370
if ($config['interfaces']['lan'])
371
	$lockout_interface = "LAN";
372
else
373
	$lockout_interface = "WAN";
374

  
375
$section->addInput(new Form_Checkbox(
376
	'Anti-lockout',
377
	'Disable webConfigurator anti-lockout rule',
378
	$pconfig['noantilockout']
379
))->setHelp('When this is '.
380
	'unchecked, access to the webConfigurator on the %s interface is always '.
381
	'permitted, regardless of the user-defined firewall rule set. Check this box to '.
382
	'disable this automatically added rule, so access to the webConfigurator is '.
383
	'controlled by the user-defined firewall rules (ensure you have a firewall rule '.
384
	'in place that allows you in, or you will lock yourself out!)<em>Hint: the &quot;Set interface(s) IP address&quot; '.
385
	'option in the console menu resets this setting as well.</em>', [$lockout_interface]);
386

  
387
$section->addInput(new Form_Checkbox(
388
	'DNS Rebind Check',
389
	'Disable DNS Rebinding Checks',
390
	$pconfig['nodnsrebindcheck']
391
))->setHelp('When this is unchecked, your system is protected against<a '.
392
	'href=\"http://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding attacks</a>. '.
393
	'This blocks private IP responses from your configured DNS servers. Check this '.
394
	'box to disable this protection if it interferes with webConfigurator access or '.
395
	'name resolution in your environment.');
396

  
397
$section->addInput(new Form_Input(
398
	'Alternate Hostnames',
399
	'text',
400
	htmlspecialchars($pconfig['althostnames'])
401
))->setHelp('Alternate Hostnames for DNS Rebinding and HTTP_REFERER Checks. Here '.
402
	'you can specify alternate hostnames by which the router may be queried, to '.
403
	'bypass the DNS Rebinding Attack checks. Separate hostnames with spaces.');
404

  
405
$section->addInput(new Form_Checkbox(
406
	'Browser HTTP_REFERER enforcement',
407
	'Disable HTTP_REFERER enforcement check',
408
	$pconfig['nohttpreferercheck']
409
))->setHelp('When this is unchecked, access to the webConfigurator is protected '.
410
	'against HTTP_REFERER redirection attempts. Check this box to disable this '.
411
	'protection if you find that it interferes with webConfigurator access in certain '.
412
	'corner cases such as using external scripts to interact with this system. More '.
413
	'information on HTTP_REFERER is available from<a target="_blank" '.
414
	'href="http://en.wikipedia.org/wiki/HTTP_referrer">Wikipedia</a>.');
415

  
416
$section->addInput($input = new Form_Checkbox(
417
	'BEAST Attack Protection',
418
	'Mitigate the BEAST SSL Attack',
419
	$pconfig['beast_protection']
420
))->setHelp('When this is checked, the webConfigurator can mitigate BEAST SSL '.
421
	'attacks. This option is off by default because Hifn accelerators do NOT work '.
422
	'with this option, and the GUI will not function. It is possible that other '.
423
	'accelerators have a similar problem that is not yet known/documented. More '.
424
	'information on BEAST is available from <a target="_blank" '.
425
	'href="https://en.wikipedia.org/wiki/Transport_Layer_Security#BEAST_attack">Wikipedia</a>.');
426

  
427
if ($disable_beast_option)
428
{
429
	$input->setAttribute('disabled', 'disabled');
430
	$input->setHelp('This option has been automatically disabled because a conflicting '.
431
	'cryptographic accelerator card has been detected (%s).', [$hwcrypto]);
432
}
286 433

  
287
	if (document.iform.https_proto.checked)
288
		document.getElementById("ssl_opts").style.display="";
289
	else
290
		document.getElementById("ssl_opts").style.display="none";
434
$section->addInput(new Form_Checkbox(
435
	'Browser tab text',
436
	'Display page name first in browser tab',
437
	$pconfig['pagenamefirst']
438
))->setHelp('When this is unchecked, the browser tab shows the host name followed '.
439
	'by the current page. Check this box to display the current page followed by the '.
440
	'host name.');
441

  
442
$form->add($section);
443
$section = new Form_Section('Secure Shell');
444

  
445
$section->addInput(new Form_Checkbox(
446
	'Secure Shell Server',
447
	'Enable Secure Shell',
448
	isset($pconfig['enablesshd'])
449
));
450

  
451
$section->addInput(new Form_Checkbox(
452
	'Authentication Method',
453
	'Disable password login for Secure Shell (RSA/DSA key only)',
454
	$pconfig['sshdkeyonly']
455
))->setHelp('When enabled, authorized keys need to be configured for each<a '.
456
	'href="system_usermanager.php">user</a>that has been granted secure shell '.
457
	'access.');
458

  
459
$section->addInput(new Form_Input(
460
	'SSH port',
461
	'number',
462
	$pconfig['sshport'],
463
	['min' => 1, 'max' => 65535]
464
))->setHelp('Note: Leave this blank for the default of 22.');
465

  
466

  
467
if (!$g['enableserial_force'] && ($g['platform'] == "pfSense" || $g['platform'] == "cdrom" || file_exists("/etc/nano_use_vga.txt")))
468
{
469
	$form->add($section);
470
	$section = new Form_Section('Serial Communications');
471

  
472
	$section->addInput(new Form_Checkbox(
473
		'Serial Terminal',
474
		'Enables the first serial port with 115200/8/N/1 by default, or another speed selectable below.',
475
		isset($pconfig['enableserial'])
476
	))->setHelp('Note:  This will redirect the console output and messages to '.
477
		'the serial port. You can still access the console menu from the internal video '.
478
		'card/keyboard. A<b>null modem</b>serial cable or adapter is required to use the '.
479
		'serial console.');
480

  
481
	$section->addInput(new Form_Select(
482
		'Serial Speed',
483
		$pconfig['serialspeed'],
484
		array(115200, 57600, 38400, 19200, 14400, 9600)
485
	))->setHelp('Allows selection of different speeds for the serial console port.');
486

  
487
	$section->addInput(new Form_Select(
488
		'Primary Console',
489
		$pconfig['primaryconsole'],
490
		array(
491
			'serial' => 'Serial Console',
492
			'video' => 'VGA Console',
493
		)
494
	))->setHelp('Select the preferred console if multiple consoles are present. '.
495
		'The preferred console will show pfSense boot script output. All consoles '.
496
		'display OS boot messages, console messages, and the console menu.');
291 497
}
292 498

  
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>
499
$form->add($section);
500
$section = new Form_Section('Console Options');
633 501

  
634
<?php
635
if ($restart_sshd) {
502
$section->addInput(new Form_Checkbox(
503
	'Console menu',
504
	'Password protect the console menu',
505
	$pconfig['disableconsolemenu']
506
));
636 507

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

  
511
include("foot.inc");
512

  
513
if ($restart_webgui)
514
	echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
515

  
516
if ($restart_sshd)
517
{
637 518
	killbyname("sshd");
638 519
	log_error(gettext("secure shell configuration has changed. Stopping sshd."));
639 520

  
......
642 523
		send_event("service restart sshd");
643 524
	}
644 525
}
645
if ($restart_webgui) {
526

  
527
if ($restart_webgui)
528
{
646 529
	ob_flush();
647 530
	flush();
648 531
	log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
649 532
	send_event("service restart webgui");
650
}
651

  
652
?>
533
}

Also available in: Unified diff