Project

General

Profile

Download (24.4 KB) Statistics
| Branch: | Tag: | Revision:
1 df81417f Matthew Grooms
<?php
2
/* $Id$ */
3
/*
4
	system_advanced_admin.php
5
	part of pfSense
6 4fe9c2dc Scott Ullrich
	Copyright (C) 2005-2010 Scott Ullrich
7 df81417f Matthew Grooms
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 1d333258 Scott Ullrich
/*
36
	pfSense_BUILDER_BINARIES:	/usr/bin/killall
37
	pfSense_MODULE:	system
38
*/
39 df81417f Matthew Grooms
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 7a927e67 Scott Ullrich
require_once("functions.inc");
49
require_once("filter.inc");
50
require_once("shaper.inc");
51 df81417f Matthew Grooms
52 fb1266d3 Matthew Grooms
$pconfig['webguiproto'] = $config['system']['webgui']['protocol'];
53
$pconfig['webguiport'] = $config['system']['webgui']['port'];
54 c41602e1 jim-p
$pconfig['max_procs'] = ($config['system']['webgui']['max_procs']) ? $config['system']['webgui']['max_procs'] : 2;
55 fb1266d3 Matthew Grooms
$pconfig['ssl-certref'] = $config['system']['webgui']['ssl-certref'];
56 36f83f68 Chris Buechler
$pconfig['disablehttpredirect'] = isset($config['system']['webgui']['disablehttpredirect']);
57 df81417f Matthew Grooms
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
58
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
59 14eab6fb jim-p
$pconfig['nodnsrebindcheck'] = isset($config['system']['webgui']['nodnsrebindcheck']);
60 4fe9c2dc Scott Ullrich
$pconfig['nohttpreferercheck'] = isset($config['system']['webgui']['nohttpreferercheck']);
61 1031c9ea jim-p
$pconfig['noautocomplete'] = isset($config['system']['webgui']['noautocomplete']);
62 86b21903 jim-p
$pconfig['althostnames'] = $config['system']['webgui']['althostnames'];
63 df81417f Matthew Grooms
$pconfig['enableserial'] = $config['system']['enableserial'];
64 c1becc31 jim-p
$pconfig['serialspeed'] = $config['system']['serialspeed'];
65 df81417f Matthew Grooms
$pconfig['enablesshd'] = $config['system']['enablesshd'];
66
$pconfig['sshport'] = $config['system']['ssh']['port'];
67 561d5162 Ermal Luçi
$pconfig['sshdkeyonly'] = isset($config['system']['ssh']['sshdkeyonly']);
68 bb3c6562 smos
$pconfig['quietlogin'] = isset($config['system']['webgui']['quietlogin']);
69 fb1266d3 Matthew Grooms
70 b4e6524c jim-p
$a_cert =& $config['cert'];
71 fb1266d3 Matthew Grooms
72
$certs_available = false;
73
if (is_array($a_cert) && count($a_cert))
74
	$certs_available = true;
75
76
if (!$pconfig['webguiproto'] || !$certs_available)
77
	$pconfig['webguiproto'] = "http";
78 df81417f Matthew Grooms
79
if ($_POST) {
80
81
	unset($input_errors);
82
	$pconfig = $_POST;
83
84
	/* input validation */
85 fb1266d3 Matthew Grooms
	if ($_POST['webguiport'])
86
		if(!is_port($_POST['webguiport']))
87 1eacdc8a Carlos Eduardo Ramos
			$input_errors[] = gettext("You must specify a valid webConfigurator port number");
88 df81417f Matthew Grooms
89 c41602e1 jim-p
	if ($_POST['max_procs'])
90
		if(!is_numeric($_POST['max_procs']) || ($_POST['max_procs'] < 1) || ($_POST['max_procs'] > 500))
91
			$input_errors[] = gettext("Max Processes must be a number 1 or greater");
92
93 86b21903 jim-p
	if ($_POST['althostnames']) {
94
		$althosts = explode(" ", $_POST['althostnames']);
95
		foreach ($althosts as $ah)
96
			if (!is_hostname($ah))
97 d1d0a1ad Vinicius Coque
				$input_errors[] = sprintf(gettext("Alternate hostname %s is not a valid hostname."),htmlspecialchars($ah));
98 86b21903 jim-p
	}
99
100 df81417f Matthew Grooms
	if ($_POST['sshport'])
101
		if(!is_port($_POST['sshport']))
102 1eacdc8a Carlos Eduardo Ramos
			$input_errors[] = gettext("You must specify a valid port number");
103 df81417f Matthew Grooms
104
	if($_POST['sshdkeyonly'] == "yes")
105
		$config['system']['ssh']['sshdkeyonly'] = "enabled";
106 f51f3989 Ermal Luçi
	else if (isset($config['system']['ssh']['sshdkeyonly']))
107 df81417f Matthew Grooms
		unset($config['system']['ssh']['sshdkeyonly']);
108
109
	ob_flush();
110
	flush();
111
112
	if (!$input_errors) {
113
114 fb1266d3 Matthew Grooms
		if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto']))
115
			$restart_webgui = true;
116
		if (update_if_changed("webgui port", $config['system']['webgui']['port'], $_POST['webguiport']))
117
			$restart_webgui = true;
118
		if (update_if_changed("webgui certificate", $config['system']['webgui']['ssl-certref'], $_POST['ssl-certref']))
119
			$restart_webgui = true;
120 c41602e1 jim-p
		if (update_if_changed("webgui max processes", $config['system']['webgui']['max_procs'], $_POST['max_procs']))
121
			$restart_webgui = true;
122 df81417f Matthew Grooms
123 f37caa93 Ermal
		if ($_POST['disablehttpredirect'] == "yes") {
124 36f83f68 Chris Buechler
			$config['system']['webgui']['disablehttpredirect'] = true;
125 f37caa93 Ermal
			$restart_webgui = true;
126
		} else {
127 36f83f68 Chris Buechler
			unset($config['system']['webgui']['disablehttpredirect']);
128 f37caa93 Ermal
			$restart_webgui = true;
129
		}
130 bb3c6562 smos
		if ($_POST['quietlogin'] == "yes") {
131
			$config['system']['webgui']['quietlogin'] = true;
132
		} else {
133
			unset($config['system']['webgui']['quietlogin']);
134
		}
135 f37caa93 Ermal
136 df81417f Matthew Grooms
		if($_POST['disableconsolemenu'] == "yes") {
137
			$config['system']['disableconsolemenu'] = true;
138 a46e450c Ermal Lu?i
			auto_login();
139 df81417f Matthew Grooms
		} else {
140
			unset($config['system']['disableconsolemenu']);
141 a46e450c Ermal Lu?i
			auto_login();
142 df81417f Matthew Grooms
		}
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")
150
			$config['system']['enableserial'] = true;
151
		else
152
			unset($config['system']['enableserial']);
153
154 c1becc31 jim-p
		if (is_numeric($_POST['serialspeed']))
155
			$config['system']['serialspeed'] = $_POST['serialspeed'];
156
		else
157
			unset($config['system']['serialspeed']);
158
159 14eab6fb jim-p
		if ($_POST['nodnsrebindcheck'] == "yes")
160
			$config['system']['webgui']['nodnsrebindcheck'] = true;
161
		else
162
			unset($config['system']['webgui']['nodnsrebindcheck']);
163
164 4fe9c2dc Scott Ullrich
		if ($_POST['nohttpreferercheck'] == "yes")
165
			$config['system']['webgui']['nohttpreferercheck'] = true;
166
		else
167
			unset($config['system']['webgui']['nohttpreferercheck']);
168
169 1031c9ea jim-p
		if ($_POST['noautocomplete'] == "yes")
170
			$config['system']['webgui']['noautocomplete'] = true;
171
		else
172
			unset($config['system']['webgui']['noautocomplete']);
173
174 86b21903 jim-p
		if ($_POST['althostnames'])
175
			$config['system']['webgui']['althostnames'] = $_POST['althostnames'];
176
		else
177
			unset($config['system']['webgui']['althostnames']);
178
179 fb1266d3 Matthew Grooms
		$sshd_enabled = $config['system']['enablesshd'];
180
		if($_POST['enablesshd'])
181 df81417f Matthew Grooms
			$config['system']['enablesshd'] = "enabled";
182 fb1266d3 Matthew Grooms
		else
183 df81417f Matthew Grooms
			unset($config['system']['enablesshd']);
184
185 09ba7f74 jim-p
		$sshd_keyonly = isset($config['system']['sshdkeyonly']);
186 fb1266d3 Matthew Grooms
		if ($_POST['sshdkeyonly'])
187 df81417f Matthew Grooms
			$config['system']['sshdkeyonly'] = true;
188 fb1266d3 Matthew Grooms
		else
189 df81417f Matthew Grooms
			unset($config['system']['sshdkeyonly']);
190
191 fb1266d3 Matthew Grooms
		$sshd_port = $config['system']['ssh']['port'];
192
		if ($_POST['sshport'])
193
			$config['system']['ssh']['port'] = $_POST['sshport'];
194 e09a935c Ermal Luçi
		else if (isset($config['system']['ssh']['port']))
195 fb1266d3 Matthew Grooms
			unset($config['system']['ssh']['port']);
196
197
		if (($sshd_enabled != $config['system']['enablesshd']) ||
198
			($sshd_keyonly != $config['system']['sshdkeyonly']) ||
199
			($sshd_port != $config['system']['ssh']['port']))
200
			$restart_sshd = true;
201
202
		if ($restart_webgui) {
203
			global $_SERVER;
204 ac005767 smos
			$http_host_port = explode("]", $_SERVER['HTTP_HOST']);
205
			/* IPv6 address check */
206
			if(strstr($_SERVER['HTTP_HOST'], "]")) {
207
				if(count($http_host_port) > 1) {
208
					array_pop($http_host_port);
209
					$host = str_replace(array("[", "]"), "", implode(":", $http_host_port));
210
					$host = "[{$host}]";
211
				} else {
212
					$host = str_replace(array("[", "]"), "", implode(":", $http_host_port));
213
					$host = "[{$host}]";
214
				}
215
			} else {
216
				list($host) = explode(":", $_SERVER['HTTP_HOST']);
217
			}
218 fb1266d3 Matthew Grooms
			$prot = $config['system']['webgui']['protocol'];
219
			$port = $config['system']['webgui']['port'];
220
			if ($port)
221
				$url = "{$prot}://{$host}:{$port}/system_advanced_admin.php";
222
			else
223 b11bd589 jim-p
				$url = "{$prot}://{$host}/system_advanced_admin.php";
224 fb1266d3 Matthew Grooms
		}
225 df81417f Matthew Grooms
226
		write_config();
227
228
		$retval = filter_configure();
229 fb1266d3 Matthew Grooms
	    $savemsg = get_std_save_message($retval);
230 0027de0a Ermal Lu?i
231 fb1266d3 Matthew Grooms
		if ($restart_webgui)
232 f0d1af93 Carlos Eduardo Ramos
			$savemsg .= sprintf("<br />" . gettext("One moment...redirecting to %s in 20 seconds."),$url);
233 fb1266d3 Matthew Grooms
234 df81417f Matthew Grooms
		conf_mount_rw();
235
		setup_serial_port();
236 1b94e73b Scott Ullrich
		// Restart dnsmasq in case dns rebinding toggled
237
		services_dnsmasq_configure();
238 df81417f Matthew Grooms
		conf_mount_ro();
239
	}
240
}
241
242 bca12a76 Vinicius Coque
$pgtitle = array(gettext("System"),gettext("Advanced: Admin Access"));
243 df81417f Matthew Grooms
include("head.inc");
244
245
?>
246
247
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
248 fb1266d3 Matthew Grooms
<?php include("fbegin.inc"); ?>
249 3c119b78 Colin Fleming
<script type="text/javascript">
250
//<![CDATA[
251 fb1266d3 Matthew Grooms
252
function prot_change() {
253
254
	if (document.iform.https_proto.checked)
255
		document.getElementById("ssl_opts").style.display="";
256
	else
257
		document.getElementById("ssl_opts").style.display="none";
258
}
259
260 3c119b78 Colin Fleming
//]]>
261 fb1266d3 Matthew Grooms
</script>
262 df81417f Matthew Grooms
<?php
263
	if ($input_errors)
264
		print_input_errors($input_errors);
265
	if ($savemsg)
266
		print_info_box($savemsg);
267
?>
268 ab3c8553 Matthew Grooms
	<form action="system_advanced_admin.php" method="post" name="iform" id="iform">
269 3c119b78 Colin Fleming
		<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="system advanced admin">
270 ab3c8553 Matthew Grooms
			<tr>
271
				<td>
272
					<?php
273
						$tab_array = array();
274 bca12a76 Vinicius Coque
						$tab_array[] = array(gettext("Admin Access"), true, "system_advanced_admin.php");
275
						$tab_array[] = array(gettext("Firewall / NAT"), false, "system_advanced_firewall.php");
276
						$tab_array[] = array(gettext("Networking"), false, "system_advanced_network.php");
277
						$tab_array[] = array(gettext("Miscellaneous"), false, "system_advanced_misc.php");
278
						$tab_array[] = array(gettext("System Tunables"), false, "system_advanced_sysctl.php");
279
						$tab_array[] = array(gettext("Notifications"), false, "system_advanced_notifications.php");
280 ab3c8553 Matthew Grooms
						display_top_tabs($tab_array);
281
					?>
282
				</td>
283
			</tr>
284
			<tr>
285 2ff19bfd Matthew Grooms
				<td id="mainarea">
286
					<div class="tabcont">
287
						<span class="vexpl">
288
							<span class="red">
289 3c119b78 Colin Fleming
								<strong><?=gettext("NOTE:"); ?>&nbsp;</strong>
290 2ff19bfd Matthew Grooms
							</span>
291 1eacdc8a Carlos Eduardo Ramos
							<?=gettext("The options on this page are intended for use by advanced users only."); ?>
292 2ff19bfd Matthew Grooms
							<br/>
293
						</span>
294
						<br/>
295 3c119b78 Colin Fleming
						<table width="100%" border="0" cellpadding="6" cellspacing="0" summary="main area">
296 ab3c8553 Matthew Grooms
							<tr>
297 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("webConfigurator"); ?></td>
298 ab3c8553 Matthew Grooms
							</tr>
299
							<tr>
300 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Protocol"); ?></td>
301 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
302 fb1266d3 Matthew Grooms
									<?php
303 ab3c8553 Matthew Grooms
										if ($pconfig['webguiproto'] == "http")
304 3c119b78 Colin Fleming
											$http_chk = "checked=\"checked\"";
305 ab3c8553 Matthew Grooms
										if ($pconfig['webguiproto'] == "https")
306 3c119b78 Colin Fleming
											$https_chk = "checked=\"checked\"";
307 ab3c8553 Matthew Grooms
										if (!$certs_available)
308 3c119b78 Colin Fleming
											$https_disabled = "disabled=\"disabled\"";
309 fb1266d3 Matthew Grooms
									?>
310 3c119b78 Colin Fleming
									<input name="webguiproto" id="http_proto" type="radio" value="http" <?=$http_chk;?> onclick="prot_change()" />
311 42c7b553 Carlos Eduardo Ramos
									<?=gettext("HTTP"); ?>
312 ab3c8553 Matthew Grooms
									&nbsp;&nbsp;&nbsp;
313 3c119b78 Colin Fleming
									<input name="webguiproto" id="https_proto" type="radio" value="https" <?=$https_chk;?> <?=$https_disabled;?> onclick="prot_change()" />
314 42c7b553 Carlos Eduardo Ramos
									<?=gettext("HTTPS"); ?>
315 ab3c8553 Matthew Grooms
									<?php if (!$certs_available): ?>
316
									<br/>
317 1eacdc8a Carlos Eduardo Ramos
									<?=gettext("No Certificates have been defined. You must"); ?>
318
									<a href="system_certmanager.php"><?=gettext("Create or Import"); ?></a>
319
									<?=gettext("a Certificate before SSL can be enabled."); ?>
320 ab3c8553 Matthew Grooms
									<?php endif; ?>
321
								</td>
322
							</tr>
323
							<tr id="ssl_opts">
324 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("SSL Certificate"); ?></td>
325 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
326
									<select name="ssl-certref" id="ssl-certref" class="formselect">
327
										<?php
328
											foreach($a_cert as $cert):
329
												$selected = "";
330
												if ($pconfig['ssl-certref'] == $cert['refid'])
331 3c119b78 Colin Fleming
													$selected = "selected=\"selected\"";
332 ab3c8553 Matthew Grooms
										?>
333 f2a86ca9 jim-p
										<option value="<?=$cert['refid'];?>"<?=$selected;?>><?=$cert['descr'];?></option>
334 ab3c8553 Matthew Grooms
										<?php endforeach; ?>
335
									</select>
336
								</td>
337
							</tr>
338
							<tr>
339 1eacdc8a Carlos Eduardo Ramos
								<td valign="top" class="vncell"><?=gettext("TCP port"); ?></td>
340 ab3c8553 Matthew Grooms
								<td class="vtable">
341 3c119b78 Colin Fleming
									<input name="webguiport" type="text" class="formfld unknown" id="webguiport" size="5" value="<?=htmlspecialchars($config['system']['webgui']['port']);?>" />
342
									<br />
343 ab3c8553 Matthew Grooms
									<span class="vexpl">
344 f0d1af93 Carlos Eduardo Ramos
										<?=gettext("Enter a custom port number for the webConfigurator " .
345
										"above if you want to override the default (80 for HTTP, 443 " .
346
										"for HTTPS). Changes will take effect immediately after save."); ?>
347 ab3c8553 Matthew Grooms
									</span>
348
								</td>
349
							</tr>
350 c41602e1 jim-p
							<tr>
351
								<td valign="top" class="vncell"><?=gettext("Max Processes"); ?></td>
352
								<td class="vtable">
353 3c119b78 Colin Fleming
									<input name="max_procs" type="text" class="formfld unknown" id="max_procs" size="5" value="<?=htmlspecialchars($pconfig['max_procs']);?>" />
354
									<br />
355 c41602e1 jim-p
									<span class="vexpl">
356
										<?=gettext("Enter the number of webConfigurator processes you " .
357
										"want to run. This defaults to 2. Increasing this will allow more " .
358
										"users/browsers to access the GUI concurrently."); ?>
359
									</span>
360
								</td>
361
							</tr>
362 f37caa93 Ermal
							<tr>
363
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI redirect"); ?></td>
364
								<td width="78%" class="vtable">
365 3c119b78 Colin Fleming
									<input name="disablehttpredirect" type="checkbox" id="disablehttpredirect" value="yes" <?php if ($pconfig['disablehttpredirect']) echo "checked=\"checked\""; ?> />
366 f37caa93 Ermal
									<strong><?=gettext("Disable webConfigurator redirect rule"); ?></strong>
367
									<br/>
368 bb3c6562 smos
									<?php echo gettext("When this is unchecked, access to the webConfigurator " .
369 1031c9ea jim-p
									"is always permitted even on port 80, regardless of the listening port configured. " .
370 f37caa93 Ermal
									"Check this box to disable this automatically added redirect rule. ");
371
									?>
372
								</td>
373
							</tr>
374 1031c9ea jim-p
							<tr>
375
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI Login Autocomplete"); ?></td>
376
								<td width="78%" class="vtable">
377 3c119b78 Colin Fleming
									<input name="noautocomplete" type="checkbox" id="noautocomplete" value="yes" <?php if ($pconfig['noautocomplete']) echo "checked=\"checked\""; ?> />
378 1031c9ea jim-p
									<strong><?=gettext("Disable webConfigurator login autocomplete"); ?></strong>
379
									<br/>
380
									<?php echo gettext("When this is unchecked, login credentials for the webConfigurator " .
381
									"may be saved by the browser. While convenient, some security standards require this to be disabled. " .
382
									"Check this box to disable autocomplete on the login form so that browsers will not prompt to save credentials (NOTE: Some browsers do not respect this option). ");
383
									?>
384
								</td>
385
							</tr>
386 ab3c8553 Matthew Grooms
							<tr>
387 bb3c6562 smos
								<td width="22%" valign="top" class="vncell"><?=gettext("WebGUI login messages"); ?></td>
388
								<td width="78%" class="vtable">
389 3c119b78 Colin Fleming
									<input name="quietlogin" type="checkbox" id="quietlogin" value="yes" <?php if ($pconfig['quietlogin']) echo "checked=\"checked\""; ?> />
390 78544d4a Chris Buechler
									<strong><?=gettext("Disable logging of webConfigurator successful logins"); ?></strong>
391 bb3c6562 smos
									<br/>
392
									<?php echo gettext("When this is checked, successful logins to the webConfigurator " .
393
									"will not be logged.");
394
									?>
395
								</td>
396
							</tr>
397
							<tr>
398 ca72c3f5 Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Anti-lockout"); ?></td>
399 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
400
									<?php
401
										if($config['interfaces']['lan']) 
402
											$lockout_interface = "LAN";
403
										else 
404
											$lockout_interface = "WAN";
405
									?>
406 3c119b78 Colin Fleming
									<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked=\"checked\""; ?> />
407 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Disable webConfigurator anti-lockout rule"); ?></strong>
408 ab3c8553 Matthew Grooms
									<br/>
409 3a3fb8ea Erik Fonnesbeck
									<?php printf(gettext("When this is unchecked, access to the webConfigurator " .
410 f49a012c Renato Botelho
									"on the %s interface is always permitted, regardless of the user-defined firewall " .
411
									"rule set. Check this box to disable this automatically added rule, so access " .
412
									"to the webConfigurator is controlled by the user-defined firewall rules " .
413
									"(ensure you have a firewall rule in place that allows you in, or you will " .
414
									"lock yourself out!)"), $lockout_interface); ?>
415
									<em> <?=gettext("Hint: the &quot;Set interface(s) IP address&quot; option in the console menu resets this setting as well."); ?> </em>
416 ab3c8553 Matthew Grooms
								</td>
417
							</tr>
418 14eab6fb jim-p
							<tr>
419
								<td width="22%" valign="top" class="vncell"><?=gettext("DNS Rebind Check"); ?></td>
420
								<td width="78%" class="vtable">
421 3c119b78 Colin Fleming
									<input name="nodnsrebindcheck" type="checkbox" id="nodnsrebindcheck" value="yes" <?php if ($pconfig['nodnsrebindcheck']) echo "checked=\"checked\""; ?> />
422 ff998f10 Chris Buechler
									<strong><?=gettext("Disable DNS Rebinding Checks"); ?></strong>
423 14eab6fb jim-p
									<br/>
424 ff998f10 Chris Buechler
									<?php echo gettext("When this is unchecked, your system " .
425 14eab6fb jim-p
									"is protected against <a href=\"http://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding attacks</a>. " .
426 ff998f10 Chris Buechler
									"This blocks private IP responses from your configured DNS servers. Check this box to disable this protection if it interferes with " .
427
									"webConfigurator access or name resolution in your environment. "); ?>
428 14eab6fb jim-p
								</td>
429
							</tr>
430 86b21903 jim-p
							<tr>
431
								<td width="22%" valign="top" class="vncell"><?=gettext("Alternate Hostnames"); ?></td>
432
								<td width="78%" class="vtable">
433
									<input name="althostnames" type="text" class="formfld unknown" id="althostnames" size="75" value="<?=htmlspecialchars($pconfig['althostnames']);?>"/>
434
									<br/>
435 612fa572 Scott Ullrich
									<strong><?=gettext("Alternate Hostnames for DNS Rebinding and HTTP_REFERER Checks"); ?></strong>
436 86b21903 jim-p
									<br/>
437
									<?php echo gettext("Here you can specify alternate hostnames by which the router may be queried, to " . 
438
									"bypass the DNS Rebinding Attack checks. Separate hostnames with spaces."); ?>
439
								</td>
440
							</tr>
441 4fe9c2dc Scott Ullrich
							<tr>
442
								<td width="22%" valign="top" class="vncell"><?=gettext("Browser HTTP_REFERER enforcement"); ?></td>
443
								<td width="78%" class="vtable">
444 3c119b78 Colin Fleming
									<input name="nohttpreferercheck" type="checkbox" id="nohttpreferercheck" value="yes" <?php if ($pconfig['nohttpreferercheck']) echo "checked=\"checked\""; ?> />
445 4fe9c2dc Scott Ullrich
									<strong><?=gettext("Disable HTTP_REFERER enforcement check"); ?></strong>
446
									<br/>
447
									<?php echo gettext("When this is unchecked, access to the webConfigurator " .
448
									"is protected against HTTP_REFERER redirection attempts. " .
449
									"Check this box to disable this protection if you find that it interferes with " .
450 3c119b78 Colin Fleming
									"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>."); ?>
451 4fe9c2dc Scott Ullrich
								</td>
452
							</tr>
453 ab3c8553 Matthew Grooms
							<tr>
454
								<td colspan="2" class="list" height="12">&nbsp;</td>
455
							</tr>
456
							<tr>
457 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Secure Shell"); ?></td>
458 ab3c8553 Matthew Grooms
							</tr>
459
							<tr>
460 ca72c3f5 Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Secure Shell Server"); ?></td>
461 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
462 3c119b78 Colin Fleming
									<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked=\"checked\""; ?> />
463 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Enable Secure Shell"); ?></strong>
464 ab3c8553 Matthew Grooms
								</td>
465
							</tr>
466
							<tr>
467 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Authentication Method"); ?></td>
468 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
469 3c119b78 Colin Fleming
									<input name="sshdkeyonly" type="checkbox" id="sshdkeyonly" value="yes" <?php if ($pconfig['sshdkeyonly']) echo "checked=\"checked\""; ?> />
470 60879d14 jim-p
									<strong><?=gettext("Disable password login for Secure Shell (RSA/DSA key only)"); ?></strong>
471 ab3c8553 Matthew Grooms
									<br/>
472 1eacdc8a Carlos Eduardo Ramos
									<?=gettext("When enabled, authorized keys need to be configured for each"); ?>
473 c395a830 Carlos Eduardo Ramos
									<a href="system_usermanager.php"><?=gettext("user"); ?></a>
474 1eacdc8a Carlos Eduardo Ramos
									<?=gettext("that has been granted secure shell access."); ?>
475 ab3c8553 Matthew Grooms
								</td>
476
							</tr>
477
							<tr>
478 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("SSH port"); ?></td>
479 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
480
									<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" />
481
									<br/>
482 22a11a58 Larry Gilbert
									<span class="vexpl"><?=gettext("Note: Leave this blank for the default of 22."); ?></span>
483 ab3c8553 Matthew Grooms
								</td>
484
							</tr>
485
							<tr>
486
								<td colspan="2" class="list" height="12">&nbsp;</td>
487
							</tr>
488
							<tr>
489 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Serial Communcations"); ?></td>
490 ab3c8553 Matthew Grooms
							</tr>
491 9d99eb95 jim-p
							<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
492 ab3c8553 Matthew Grooms
							<tr>
493 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Terminal"); ?></td>
494 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
495 3c119b78 Colin Fleming
									<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked=\"checked\""; ?> />
496 c1becc31 jim-p
									<strong><?=gettext("Enables the first serial port with 9600/8/N/1 by default, or another speed selectable below."); ?></strong>
497 5a05633a jim-p
									<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>
498 ab3c8553 Matthew Grooms
								</td>
499
							</tr>
500 9d99eb95 jim-p
							<?php endif; ?>
501 c1becc31 jim-p
							<tr>
502
								<td width="22%" valign="top" class="vncell"><?=gettext("Serial Speed")?></td>
503
								<td width="78%" class="vtable">
504
									<select name="serialspeed" id="serialspeed" class="formselect">
505 3c119b78 Colin Fleming
										<option value="9600"   <?php if ($pconfig['serialspeed'] == "9600")   echo "selected=\"selected\"";?>>9600</option>
506
										<option value="14400"  <?php if ($pconfig['serialspeed'] == "14400")  echo "selected=\"selected\"";?>>14400</option>
507
										<option value="19200"  <?php if ($pconfig['serialspeed'] == "19200")  echo "selected=\"selected\"";?>>19200</option>
508
										<option value="38400"  <?php if ($pconfig['serialspeed'] == "38400")  echo "selected=\"selected\"";?>>38400</option>
509
										<option value="57600"  <?php if ($pconfig['serialspeed'] == "57600")  echo "selected=\"selected\"";?>>57600</option>
510
										<option value="115200" <?php if ($pconfig['serialspeed'] == "115200") echo "selected=\"selected\"";?>>115200</option>
511 c1becc31 jim-p
									</select> bps
512 9d99eb95 jim-p
									<br/><?=gettext("Allows selection of different speeds for the serial console port."); ?>
513 c1becc31 jim-p
								</td>
514
							</tr>
515 ab3c8553 Matthew Grooms
							<tr>
516
								<td colspan="2" class="list" height="12">&nbsp;</td>
517
							</tr>
518
							<tr>
519 1eacdc8a Carlos Eduardo Ramos
								<td colspan="2" valign="top" class="listtopic"><?=gettext("Console Options"); ?></td>
520 ab3c8553 Matthew Grooms
							</tr>
521
							<tr>
522 1eacdc8a Carlos Eduardo Ramos
								<td width="22%" valign="top" class="vncell"><?=gettext("Console menu"); ?></td>
523 ab3c8553 Matthew Grooms
								<td width="78%" class="vtable">
524 3c119b78 Colin Fleming
									<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked=\"checked\""; ?>  />
525 1eacdc8a Carlos Eduardo Ramos
									<strong><?=gettext("Password protect the console menu"); ?></strong>
526 ab3c8553 Matthew Grooms
									<br/>
527 1eacdc8a Carlos Eduardo Ramos
									<span class="vexpl"><?=gettext("Changes to this option will take effect after a reboot."); ?></span>
528 ab3c8553 Matthew Grooms
								</td>
529
							</tr>
530
							<tr>
531 306f082a Scott Ullrich
								<td colspan="2" class="list" height="12">&nbsp;</td>
532
							</tr>							
533
							<tr>
534 ab3c8553 Matthew Grooms
								<td width="22%" valign="top">&nbsp;</td>
535 bca12a76 Vinicius Coque
								<td width="78%"><input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save");?>" /></td>
536 ab3c8553 Matthew Grooms
							</tr>
537
							<tr>
538
								<td colspan="2" class="list" height="12">&nbsp;</td>
539
							</tr>
540
						</table>
541
					</div>
542
				</td>
543
			</tr>
544
		</table>
545
	</form>
546 3c119b78 Colin Fleming
	<script type="text/javascript">
547
	//<![CDATA[
548 fb1266d3 Matthew Grooms
		prot_change();
549 3c119b78 Colin Fleming
	//]]>
550 fb1266d3 Matthew Grooms
	</script>
551 df81417f Matthew Grooms
552
<?php include("fend.inc"); ?>
553 fb1266d3 Matthew Grooms
<?php
554
	if ($restart_webgui)
555 3c119b78 Colin Fleming
		echo "<meta http-equiv=\"refresh\" content=\"20;url={$url}\" />";
556 fb1266d3 Matthew Grooms
?>
557 df81417f Matthew Grooms
</body>
558
</html>
559
560
<?php
561 fb1266d3 Matthew Grooms
if ($restart_sshd) {
562 df81417f Matthew Grooms
563 56c91631 Ermal
	killbyname("sshd");
564 1eacdc8a Carlos Eduardo Ramos
	log_error(gettext("secure shell configuration has changed. Stopping sshd."));
565 fb1266d3 Matthew Grooms
566
	if ($config['system']['enablesshd']) {
567 1eacdc8a Carlos Eduardo Ramos
		log_error(gettext("secure shell configuration has changed. Restarting sshd."));
568 0ae6daf8 Ermal
		send_event("service restart sshd");
569 df81417f Matthew Grooms
	}
570
}
571 fb1266d3 Matthew Grooms
if ($restart_webgui) {
572
	ob_flush();
573
	flush();
574 1eacdc8a Carlos Eduardo Ramos
	log_error(gettext("webConfigurator configuration has changed. Restarting webConfigurator."));
575 fbd5fc52 Ermal
	send_event("service restart webgui");
576 fb1266d3 Matthew Grooms
}
577 1d333258 Scott Ullrich
578 42c7b553 Carlos Eduardo Ramos
?>