Project

General

Profile

Download (27.2 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/* $Id$ */
3
/*
4
	system_advanced.php
5
        part of pfSense
6
        Copyright (C) 2005 Scott Ullrich
7

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

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

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

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

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

    
34
require("guiconfig.inc");
35

    
36
$pconfig['disablefilter'] = $config['system']['disablefilter'];
37
$pconfig['rfc959workaround'] = $config['system']['rfc959workaround'];
38
$pconfig['ipv6nat_enable'] = isset($config['diag']['ipv6nat']['enable']);
39
$pconfig['ipv6nat_ipaddr'] = $config['diag']['ipv6nat']['ipaddr'];
40
$pconfig['cert'] = base64_decode($config['system']['webgui']['certificate']);
41
$pconfig['key'] = base64_decode($config['system']['webgui']['private-key']);
42
$pconfig['disableconsolemenu'] = isset($config['system']['disableconsolemenu']);
43
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
44
$pconfig['noantilockout'] = isset($config['system']['webgui']['noantilockout']);
45
$pconfig['filteringbridge_enable'] = isset($config['bridge']['filteringbridge']);
46
$pconfig['tcpidletimeout'] = $config['filter']['tcpidletimeout'];
47
/* billm: alternate schedulers are currently disable */
48
/* 
49
 * $pconfig['schedulertype'] = $config['shaper']['schedulertype'];
50
 */
51
$pconfig['maximumstates'] = $config['system']['maximumstates'];
52
$pconfig['theme'] = $config['system']['theme'];
53
$pconfig['disablerendevouz'] = $config['system']['disablerendevouz'];
54
$pconfig['enableserial'] = $config['system']['enableserial'];
55
$pconfig['disablefirmwarecheck'] = isset($config['system']['disablefirmwarecheck']);
56
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
57
$pconfig['enablesshd'] = $config['system']['enablesshd'];
58
$pconfig['sshport'] = $config['system']['ssh']['port'];
59
$pconfig['sharednet'] = $config['system']['sharednet'];
60
$pconfig['polling_enable'] = isset($config['system']['polling']);
61

    
62
$pconfig['disablenatreflection'] = $config['system']['disablenatreflection'];
63

    
64
if ($_POST) {
65

    
66
	unset($input_errors);
67
	$pconfig = $_POST;
68

    
69
	/* input validation */
70
	if ($_POST['ipv6nat_enable'] && !is_ipaddr($_POST['ipv6nat_ipaddr'])) {
71
		$input_errors[] = "You must specify an IP address to NAT IPv6 packets.";
72
	}
73
	if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
74
		$input_errors[] = "The Firewall Maximum States value must be an integer.";
75
	}
76
	if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
77
		$input_errors[] = "The TCP idle timeout must be an integer.";
78
	}
79
	if (($_POST['cert'] && !$_POST['key']) || ($_POST['key'] && !$_POST['cert'])) {
80
		$input_errors[] = "Certificate and key must always be specified together.";
81
	} else if ($_POST['cert'] && $_POST['key']) {
82
		if (!strstr($_POST['cert'], "BEGIN CERTIFICATE") || !strstr($_POST['cert'], "END CERTIFICATE"))
83
			$input_errors[] = "This certificate does not appear to be valid.";
84
		if (!strstr($_POST['key'], "BEGIN RSA PRIVATE KEY") || !strstr($_POST['key'], "END RSA PRIVATE KEY"))
85
			$input_errors[] = "This key does not appear to be valid.";
86
	if ($_POST['altfirmwareurl'])
87
		if ($_POST['firmwareurl'] == "" || $_POST['firmwarename'] == "")
88
		$input_errors[] = "You must specify a base URL and a filename for the alternate firmware.";
89
	if ($_POST['altpkgconfigurl'])
90
		if ($_POST['pkgconfig_base_url'] == "" || $_POST['pkgconfig_filename'] == "")
91
		$input_errors[] = "You must specifiy and base URL and a filename before using an alternate pkg_config.xml.";
92
	}
93
	if ($_POST['maximumstates'] <> "") {
94
		if ($_POST['maximumstates'] < 1000)
95
			$input_errors[] = "States must be above 1000 and below 100000000";
96
		if ($_POST['maximumstates'] > 100000000)
97
			$input_errors[] = "States must be above 1000 and below 100000000";
98
	}
99
	if ($_POST['sshport'] <> "") {
100
		if( ! is_port($_POST['sshport'])) {
101
			$input_errors[] = "You must specify a valid port number";
102
		}
103
	}
104

    
105
	if (!$input_errors) {
106
		if($_POST['disablefilter'] == "yes") {
107
			$config['system']['disablefilter'] = "enabled";
108
		} else {
109
			unset($config['system']['disablefilter']);
110
		}
111
		if($_POST['enablesshd'] == "yes") {
112
			$config['system']['enablesshd'] = "enabled";
113
			touch("{$g['tmp_path']}/start_sshd");
114
		} else {
115
			unset($config['system']['enablesshd']);
116
			mwexec("/usr/bin/killall sshd");
117
		}		
118
		$oldsshport = $config['system']['ssh']['port'];
119
		$config['system']['ssh']['port'] = $_POST['sshport'];
120

    
121
		if($_POST['polling_enable'] == "yes") { 
122
			$config['system']['polling'] = true;
123
			setup_polling();
124
		} else {
125
			unset($config['system']['polling']);
126
			setup_polling();
127
		}
128

    
129
		if($_POST['sharednet'] == "yes") {
130
			$config['system']['sharednet'] = true;
131
			system_disable_arp_wrong_if();
132
		} else {
133
			unset($config['system']['sharednet']);
134
			system_enable_arp_wrong_if();
135
		}		
136

    
137
		if($_POST['rfc959workaround'] == "yes")
138
			$config['system']['rfc959workaround'] = "enabled";
139
		else
140
			unset($config['system']['rfc959workaround']);
141

    
142
		if($_POST['ipv6nat_enable'] == "yes") {
143
			$config['diag']['ipv6nat']['enable'] = true;
144
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
145
		} else {
146
			unset($config['diag']['ipv6nat']['enable']);
147
			unset($config['diag']['ipv6nat']['ipaddr']);
148
		}
149
		$oldcert = $config['system']['webgui']['certificate'];
150
		$oldkey = $config['system']['webgui']['private-key'];
151
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
152
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
153
		if($_POST['disableconsolemenu'] == "yes") {
154
			$config['system']['disableconsolemenu'] = true;
155
			auto_login(true);
156
		} else {
157
			unset($config['system']['disableconsolemenu']);
158
			auto_login(false);
159
		}
160
		unset($config['system']['webgui']['expanddiags']);
161
		$config['system']['optimization'] = $_POST['optimization'];
162
		
163
		if($_POST['disablefirmwarecheck'] == "yes")
164
			$config['system']['disablefirmwarecheck'] = true;
165
		else
166
			unset($config['system']['disablefirmwarecheck']);
167

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

    
173
		if($_POST['harddiskstandby'] <> "") {
174
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
175
			system_set_harddisk_standby();
176
		} else
177
			unset($config['system']['harddiskstandby']);
178

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

    
184
		/* Firewall and ALTQ options */
185
		/* alternate scheduler types are currently unsupported */
186
		//$config['shaper']['schedulertype'] = $_POST['schedulertype'];
187
		$config['system']['maximumstates'] = $_POST['maximumstates'];
188

    
189
		if($_POST['enablesshd'] == "yes") {
190
			$config['system']['enablesshd'] = $_POST['enablesshd'];
191
		} else {
192
			unset($config['system']['enablesshd']);
193
		}
194

    
195
		if($_POST['disablenatreflection'] == "yes") {
196
			$config['system']['disablenatreflection'] = $_POST['disablenatreflection'];
197
		} else {
198
			unset($config['system']['disablenatreflection']);
199
		}
200
	
201
                $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
202
	
203
		$config['bridge']['filteringbridge'] = $_POST['filteringbridge_enable'] ? true : false;	
204
	
205
		/* pfSense themes */
206
		$config['theme'] = $_POST['theme'];
207

    
208
		write_config();
209
			
210
		$retval = 0;
211
		config_lock();
212
		$retval = filter_configure();
213
		if(stristr($retval, "error") <> true)
214
		    $savemsg = get_std_save_message($retval);
215
		else
216
		    $savemsg = $retval;
217
		$retval |= interfaces_optional_configure();
218
		config_unlock();
219

    
220
		conf_mount_rw();
221

    
222
		/* serial console - write out /boot.config */
223
		if(file_exists("/boot.config"))
224
			$boot_config = file_get_contents("/boot.config");
225
		else
226
			$boot_config = "";
227
			
228
		$boot_config_split = split("\n", $boot_config);
229
		if($g['platform'] <> "cdrom") {
230
			$fd = fopen("/boot.config","w");
231
			if($fd) {
232
				foreach($boot_config_split as $bcs) {
233
					if(stristr($bcs, "-D")) {
234
						/* DONT WRITE OUT, WE'LL DO IT LATER */	
235
					} else {
236
						if($bcs <> "")
237
							fwrite($fd, "{$bcs}\n");
238
					}
239
				}
240
				if(isset($config['system']['enableserial'])) {
241
					fwrite($fd, "-D");
242
				}			
243
				fclose($fd);
244
			}
245
			/* serial console - write out /boot/loader.conf */
246
			$boot_config = file_get_contents("/boot/loader.conf");	
247
			$boot_config_split = split("\n", $boot_config);
248
			$fd = fopen("/boot/loader.conf","w");
249
			if($fd) {
250
				foreach($boot_config_split as $bcs) {
251
					if(stristr($bcs, "console")) {
252
						/* DONT WRITE OUT, WE'LL DO IT LATER */	
253
					} else {
254
						if($bcs <> "")
255
							fwrite($fd, "{$bcs}\n");
256
					}
257
				}
258
				if(isset($config['system']['enableserial'])) {
259
					fwrite($fd, "console=\"comconsole\"\n");
260
				}
261
				fclose($fd);
262
			}
263
		}
264
		
265
		conf_mount_ro();
266
		
267
		setup_filter_bridge();
268
		
269
	}
270
}
271

    
272
$pgtitle = "System: Advanced functions";
273
include("head.inc");
274

    
275
?>
276

    
277
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
278

    
279
<?php include("fbegin.inc"); ?>
280

    
281
<p class="pgtitle"><?=$pgtitle?></p>
282

    
283
<form action="system_advanced.php" method="post" name="iform" id="iform">
284
<?php if ($input_errors) print_input_errors($input_errors); ?>
285
<?php if ($savemsg) print_info_box($savemsg); ?>
286
<p><span class="vexpl"><span class="red"><strong>Note: </strong></span>the options on this page are intended for use by advanced users only.</span></p>
287
<br />
288

    
289
<table width="100%" border="0" cellpadding="6" cellspacing="0">
290
	<tbody>
291
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
292
		<tr>
293
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
294
		</tr>
295
		<tr>
296
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
297
			<td width="78%" class="vtable">
298
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
299
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
300
				<br>
301
				<span class="vexpl">Note:  This will disable the internal video card/keyboard</span>
302
			</td>
303
		</tr>
304
		<tr>
305
			<td width="22%" valign="top">&nbsp;</td>
306
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
307
		</tr>
308
		</tr>
309
		<tr>
310
			<td colspan="2" class="list" height="12"></td>
311
		</tr>		
312
		<?php endif; ?>
313
		<tr>
314
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
315
		</tr>
316
		<tr>
317
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
318
			<td width="78%" class="vtable">
319
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
320
				<strong>Enable Secure Shell</strong>
321
			</td>
322
		</tr>
323
		<tr>
324
			<td width="22%" valign="top" class="vncell">SSH port</td>
325
			<td width="78%" class="vtable">
326
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
327
				<br />
328
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
329
			</td>
330
		</tr>
331
		<tr>
332
			<td width="22%" valign="top">&nbsp;</td>
333
			<td width="78%">
334
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
335
			</td>
336
		</tr>
337
		<tr>
338
			<td colspan="2" class="list" height="12">&nbsp;</td>
339
		</tr>		
340
		<tr>
341
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
342
		</tr>
343
		<tr>
344
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
345
			<td width="78%" class="vtable">
346
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
347
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
348
			</td>
349
		</tr>
350
		<tr>
351
			<td width="22%" valign="top">&nbsp;</td>
352
			<td width="78%">
353
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
354
			</td>
355
		</tr>
356
		<tr>
357
			<td colspan="2" class="list" height="12">&nbsp;</td>
358
		</tr>	
359
		<tr>
360
			<td colspan="2" valign="top" class="listtopic">Theme</td>
361
		</tr>
362
		<tr>
363
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
364
			<td width="78%" class="vtable">
365
			    <select name="theme">
366
<?php
367
				$files = return_dir_as_array("/usr/local/www/themes/");
368
				foreach($files as $f) {
369
					if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
370
					if($f == "CVS") continue;
371
					$selected = "";
372
					if($f == $config['theme'])
373
						$selected = " SELECTED";
374
					if($config['theme'] == "" and $f == "pfsense")
375
						$selceted = " SELECTED";
376
					echo "\t\t\t\t\t"."<option{$selected}>{$f}</option>\n";
377
				}
378
?>
379
				</select>
380
				<strong>This will change the look and feel of pfSense</strong>
381
			</td>
382
		</tr>
383
		<tr>
384
			<td width="22%" valign="top">&nbsp;</td>
385
			<td width="78%">
386
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
387
			</td>
388
		</tr>
389
		<tr>
390
			<td colspan="2" class="list" height="12">&nbsp;</td>
391
		</tr>
392
		<tr>
393
			<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
394
		</tr>
395
		<tr>
396
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
397
			<td width="78%" class="vtable">
398
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
399
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
400
				<br /> <br />
401
				<input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
402
				&nbsp;(IP address)<span class="vexpl"><br /> Don't forget to add a firewall rule to permit IPv6 packets!</span>
403
			</td>
404
		</tr>
405
		<tr>
406
			<td colspan="2" class="list" height="12">&nbsp;</td>
407
		</tr>		
408
		<tr>
409
			<td colspan="2" valign="top" class="listtopic">Filtering Bridge</td>
410
		</tr>
411
                <tr> 
412
                  <td width="22%" valign="top" class="vncell">&nbsp;</td>
413
                  <td width="78%" class="vtable"> 
414
                    <input name="filteringbridge_enable" type="checkbox" id="filteringbridge_enable" value="yes" <?php if ($pconfig['filteringbridge_enable']) echo "checked"; ?>>
415
                    <strong>Enable filtering bridge</strong><span class="vexpl"><br>
416
                    This will cause bridged packets to pass through the packet 
417
                    filter in the same way as routed packets do (by default bridged 
418
                    packets are always passed). If you enable this option, you'll 
419
                    have to add filter rules to selectively permit traffic from 
420
                    bridged interfaces.</span></td>
421
                </tr>			
422
		<tr>
423
			<td width="22%" valign="top">&nbsp;</td>
424
			<td width="78%">
425
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
426
			</td>
427
		</tr>
428
		<tr>
429
			<td colspan="2" class="list" height="12">&nbsp;</td>
430
		</tr>
431
		<tr>
432
			<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
433
		</tr>
434
		<tr>
435
			<td width="22%" valign="top" class="vncell">Certificate</td>
436
			<td width="78%" class="vtable">
437
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
438
				<br />
439
				Paste a signed certificate in X.509 PEM format here. <a href="javascript:if(openwindow('system_advanced_create_certs.php') == false) alert('Popup blocker detected.  Action aborted.');" >Create</a> certificates automatically.
440
			</td>
441
		</tr>
442
		<tr>
443
			<td width="22%" valign="top" class="vncell">Key</td>
444
			<td width="78%" class="vtable">
445
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
446
				<br />
447
				Paste an RSA private key in PEM format here.
448
			</td>
449
		</tr>
450
		<tr>
451
			<td width="22%" valign="top">&nbsp;</td>
452
			<td width="78%">
453
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
454
			</td>
455
		</tr>
456
		<tr>
457
			<td colspan="2" class="list" height="12">&nbsp;</td>
458
		</tr>
459
		<tr>
460
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
461
		</tr>
462

    
463
                <tr>
464
                  <td width="22%" valign="top" class="vncell">Device polling</td>
465
                  <td width="78%" class="vtable">
466
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
467
                    <strong>Use device polling</strong><br>
468
                                        Device polling is a technique that lets the system periodically poll network devices for new
469
                                        data instead of relying on interrupts. This can reduce CPU load and therefore increase
470
                                        throughput, at the expense of a slightly higher forwarding delay (the devices are polled 1000 times
471
                                        per second). Not all NICs support polling; see the pfSense homepage for a list of supported cards.
472
                  </td>
473
                </tr>
474
		
475
		<tr>
476
			<td width="22%" valign="top" class="vncell">Console menu </td>
477
			<td width="78%" class="vtable">
478
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
479
				<strong>Disable console menu</strong>
480
				<br />
481
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
482
			</td>
483
		</tr>
484
		<tr>
485
			<td valign="top" class="vncell">Firmware version check</td>
486
			<td class="vtable">
487
				<input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>  />
488
				<strong>Disable firmware version check</strong>
489
				<br />
490
				<span class="vexpl">This will cause pfSense not to check for newer firmware versions when the <a href="system_firmware.php">System: Firmware</a> page is viewed.</span>
491
			</td>
492
		</tr>
493
<?php if($g['platform'] == "pfSense"): ?>		
494
		<tr>
495
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
496
			<td width="78%" class="vtable">
497
				<select name="harddiskstandby" class="formfld">
498
<?php
499
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
500
					$sbvals = explode(" ", "0.5,6 1,12 2,24 3,36 4,48 5,60 7.5,90 10,120 15,180 20,240 30,241 60,242");
501
?>
502
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
503
<?php
504
					foreach ($sbvals as $sbval):
505
						list($min,$val) = explode(",", $sbval); ?>
506
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
507
<?php 				endforeach; ?>
508
				</select>
509
				<br />
510
				Puts the hard disk into standby mode when the selected amount of time after the last
511
				access has elapsed. <em>Do not set this for CF cards.</em>
512
			</td>
513
		</tr>
514
<?php endif; ?>		
515
		<tr>
516
			<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
517
			<td width="78%" class="vtable">
518
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
519
				<strong>Disable webGUI anti-lockout rule</strong>
520
				<br />
521
				By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter 
522
				rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you 
523
				in, or you will lock yourself out!).
524
				<br />
525
				Hint: the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.
526
			</td>
527
		</tr>
528
		<tr>
529
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
530
			<td width="78%" class="vtable">
531
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
532
				<strong>Prefer old IPsec SAs</strong>
533
				<br />
534
				By default, if several SAs match, the newest one is preferred if it's at least 30 seconds old.Select this option to always prefer old SAs over new ones.
535
			</td>
536
		</tr>		
537
		<tr>
538
			<td width="22%" valign="top">&nbsp;</td>
539
			<td width="78%">
540
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
541
			</td>
542
		</tr>
543
		<tr>
544
			<td colspan="2" class="list" height="12">&nbsp;</td>
545
		</tr>
546
		<tr>
547
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
548
		</tr>
549
		<tr>
550
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
551
			<td width="78%" class="vtable">
552
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
553
				<strong class="vexpl">Workaround for sites that violate RFC 959 which specifies that the data connection be sourced from the command port - 1 (typically port 20).  This workaround doesn't expose you to any extra risk as the firewall will still only allow connections on a port that the ftp-proxy is listening on.</strong>
554
				<br />
555
			</td>
556
		</tr>
557
<!---
558
		<tr>
559
			<td width="22%" valign="top" class="vncell">Traffic Shaper Scheduler</td>
560
			<td width="78%" class="vtable">
561
				<select id="schedulertype" name="schedulertype" <?= $style ?>>
562
					<option value="priq"<?php if($pconfig['schedulertype'] == 'priq') echo " selected"; ?>>Priority based queueing</option>
563
					<option value="cbq"<?php if($pconfig['schedulertype'] == 'cbq') echo " selected"; ?>>Class based queueing</option>
564
					<option value="hfsc"<?php if($pconfig['schedulertype'] == 'hfsc') echo " selected"; ?>>Hierarchical Fair Service Curve queueing</option>
565
				</select>
566
				<br />
567
				<span class="vexpl"><b>Select which type of queueing you would like to use</b></span>
568
				<?php if (is_array($config['shaper']['queue']) > 0): ?>
569
				<script language="javascript" type="text/javascript">
570
					document.iform.schedulertype.disabled = 1;
571
				</script>
572
				<br />
573
				NOTE: This option is disabled since there are queues defined.
574
				<?php endif; ?>
575
			</td>
576
		</tr>
577
-->
578
		<tr>
579
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
580
			<td width="78%" class="vtable">
581
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
582
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
583
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
584
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
585
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
586
				</select>
587
				<br />
588
				<textarea cols="60" rows="2" id="info" name="info"style="padding:5px; border:1px dashed #990000; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
589
				<script language="javascript" type="text/javascript">
590
					update_description(document.forms[0].optimization.selectedIndex);
591
				</script>
592
				<br />
593
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
594
			</td>
595
		</tr>
596
		<tr>
597
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
598
			<td width="78%" class="vtable">
599
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
600
				<strong>Disable the firewalls filter altogether.</strong>
601
				<br />
602
				<span class="vexpl">Note:  This basically converts pfSense into a routing only platform!<br>
603
				                    Note:  This will turn off NAT!
604
				</span>
605
			</td>
606
		</tr>
607
		<tr>
608
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
609
			<td width="78%" class="vtable">
610
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
611
				<br />
612
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
613
				<br />
614
				<span class="vexpl">Note:  Leave this blank for the default of 10000</span>
615
			</td>
616
		</tr>
617
		<tr>
618
			<td width="22%" valign="top">&nbsp;</td>
619
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
620
		</tr>
621
		<tr>
622
			<td colspan="2" class="list" height="12">&nbsp;</td>
623
		</tr>		
624
		<tr>
625
			<td colspan="2" valign="top" class="listtopic">Network Address Translation</td>
626
		</tr>
627
		<tr>
628
			<td width="22%" valign="top" class="vncell">Disable NAT Reflection</td>
629
			<td width="78%" class="vtable">
630
				<input name="disablenatreflection" type="checkbox" id="disablenatreflection" value="yes" <?php if (isset($config['system']['disablenatreflection'])) echo "checked"; ?> onclick="enable_change(false)" />
631
				<strong>Disables the automatic creation of NAT redirect rules for access to your public IP addresses from within your internal networks</strong>
632
			</td>
633
		</tr>
634
		<tr>
635
			<td width="22%" valign="top">&nbsp;</td>
636
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
637
		</tr>
638
		<tr>
639
			<td colspan="2" class="list" height="12">&nbsp;</td>
640
		</tr>
641
	</tbody>
642
</table>
643
</form>
644

    
645
<script language="JavaScript" type="text/javascript">
646
<!--
647
	enable_change(false);
648
	//enable_altfirmwareurl(false);
649
	//enable_altpkgconfigurl(false);
650
//-->
651
</script>
652

    
653
<?php include("fend.inc"); ?>
654

    
655
<?php
656

    
657
if (($config['system']['webgui']['certificate'] != $oldcert)
658
		|| ($config['system']['webgui']['private-key'] != $oldkey)) {
659
	touch("/tmp/restart_webgui");
660
}
661

    
662
function auto_login($status) {
663
	$gettytab = file_get_contents("/etc/gettytab");
664
	$getty_split = split("\n", $gettytab);
665
	conf_mount_rw();
666
	$fd = fopen("/etc/gettytab", "w");
667
	foreach($getty_split as $gs) {
668
		if(stristr($gs, "cb:ce:ck:lc") == true) {
669
			if($status == true) {
670
				fwrite($fd, ":cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
671
			} else {
672
				fwrite($fd, ":al=root:cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
673
			}
674
		} else {
675
			fwrite($fd, "{$gs}\n");
676
		}
677
	}
678
	fclose($fd);
679
	conf_mount_ro();	
680
}
681

    
682
?>
683
</body>
684
</html>
(120-120/155)