Project

General

Profile

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

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

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

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

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

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

    
35
require("guiconfig.inc");
36

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

    
60
if ($_POST) {
61

    
62
	unset($input_errors);
63
	$pconfig = $_POST;
64

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

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

    
117
		if($_POST['polling_enable'] == "yes")
118
			$config['system']['polling'] = true;
119
		else
120
			unset($config['system']['polling']);
121

    
122
		if($_POST['sharednet'] == "yes") {
123
			$config['system']['sharednet'] = true;
124
			system_disable_arp_wrong_if();
125
		} else {
126
			unset($config['system']['sharednet']);
127
			system_enable_arp_wrong_if();
128
		}		
129

    
130
		if($_POST['disableftpproxy'] == "yes") {
131
			$config['system']['disableftpproxy'] = "enabled";
132
			unset($config['system']['rfc959workaround']);
133
			system_start_ftp_helpers();
134
		} else {
135
			unset($config['system']['disableftpproxy']);
136
			system_start_ftp_helpers();
137
		}
138
		if($_POST['rfc959workaround'] == "yes")
139
			$config['system']['rfc959workaround'] = "enabled";
140
		else
141
			unset($config['system']['rfc959workaround']);
142

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

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

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

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

    
183
		/* Firewall and ALTQ options */
184
		$config['shaper']['schedulertype'] = $_POST['schedulertype'];
185
		$config['system']['maximumstates'] = $_POST['maximumstates'];
186

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

    
193
                $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
194
	
195
		/* pfSense themes */
196
		$config['theme'] = $_POST['theme'];
197

    
198
		write_config();
199

    
200
		if (($config['system']['webgui']['certificate'] != $oldcert)
201
				|| ($config['system']['webgui']['private-key'] != $oldkey)) {
202
			system_webgui_start();
203
		}
204

    
205
			
206
		$retval = 0;
207
		config_lock();
208
		$retval = filter_configure();
209
		if(stristr($retval, "error") <> true)
210
		    $savemsg = get_std_save_message($retval);
211
		else
212
		    $savemsg = $retval;
213
		$retval |= interfaces_optional_configure();
214
		config_unlock();
215

    
216
		/* serial console */
217
		if(file_exists("/boot.config"))
218
			$boot_config = file_get_contents("/boot.config");
219
		else
220
			$boot_config = "";
221
			
222
		$boot_config_split = split("\n", $boot_config);
223
		
224
		conf_mount_rw();
225
		
226
		$fd = fopen("/boot.config","w");
227
		if($fd) {
228
			foreach($boot_config_split as $bcs) {
229
				if(stristr($bcs, "-D")) {
230
					if(isset($config['system']['enableserial'])) {
231
						fwrite($fd, "-D");
232
					}
233
				} else {
234
					fwrite($fd, "{$bcs}\n");
235
				}
236
			}
237
			fclose($fd);
238
		}
239
		
240
		conf_mount_ro();
241
		
242
	}
243
}
244

    
245
$pgtitle = "System: Advanced functions";
246
include("head.inc");
247

    
248
?>
249

    
250
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
251

    
252
<?php include("fbegin.inc"); ?>
253

    
254
<p class="pgtitle"><?=$pgtitle?></p>
255

    
256
<form action="system_advanced.php" method="post" name="iform" id="iform">
257
<?php if ($input_errors) print_input_errors($input_errors); ?>
258
<?php if ($savemsg) print_info_box($savemsg); ?>
259
<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>
260
<br />
261

    
262
<table width="100%" border="0" cellpadding="6" cellspacing="0">
263
	<tbody>
264
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
265
		<tr>
266
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
267
		</tr>
268
		<tr>
269
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
270
			<td width="78%" class="vtable">
271
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
272
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
273
			</td>
274
		</tr>
275
		<tr>
276
			<td width="22%" valign="top">&nbsp;</td>
277
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
278
		</tr>
279
		</tr>
280
		<tr>
281
			<td colspan="2" class="list" height="12"></td>
282
		</tr>		
283
		<?php endif ?>
284
		<tr>
285
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
286
		</tr>
287
		<tr>
288
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
289
			<td width="78%" class="vtable">
290
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
291
				<strong>Enable Secure Shell</strong>
292
			</td>
293
		</tr>
294
		<tr>
295
			<td width="22%" valign="top" class="vncell">SSH port</td>
296
			<td width="78%" class="vtable">
297
				<input name="sshport" type="text" id="sshport" value="<?php echo $pconfig['sshport']; ?>" onclick="enable_change(false)" />
298
				<br />
299
				<span class="vexpl">Note:  Leave this blank for the default of 22</span>
300
			</td>
301
		</tr>
302
		<tr>
303
			<td width="22%" valign="top">&nbsp;</td>
304
			<td width="78%">
305
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
306
			</td>
307
		</tr>
308
		<tr>
309
			<td colspan="2" class="list" height="12">&nbsp;</td>
310
		</tr>		
311
		<tr>
312
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
313
		</tr>
314
		<tr>
315
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
316
			<td width="78%" class="vtable">
317
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
318
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
319
			</td>
320
		</tr>
321
		<tr>
322
			<td width="22%" valign="top">&nbsp;</td>
323
			<td width="78%">
324
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
325
			</td>
326
		</tr>
327
		<tr>
328
			<td colspan="2" class="list" height="12">&nbsp;</td>
329
		</tr>	
330
		<tr>
331
			<td colspan="2" valign="top" class="listtopic">Theme</td>
332
		</tr>
333
		<tr>
334
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
335
			<td width="78%" class="vtable">
336
			    <select name="theme">
337
<?php
338
				$files = return_dir_as_array("/usr/local/www/themes/");
339
				foreach($files as $f) {
340
					if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
341
					if($f == "CVS") continue;
342
					$selected = "";
343
					if($f == $config['theme'])
344
						$selected = " SELECTED";
345
					if($config['theme'] == "" and $f == "pfsense")
346
						$selceted = " SELECTED";
347
					echo "\t\t\t\t\t"."<option{$selected}>{$f}</option>\n";
348
				}
349
?>
350
				</select>
351
				<strong>This will change the look and feel of pfSense</strong>
352
			</td>
353
		</tr>
354
		<tr>
355
			<td width="22%" valign="top">&nbsp;</td>
356
			<td width="78%">
357
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
358
			</td>
359
		</tr>
360
		<tr>
361
			<td colspan="2" class="list" height="12">&nbsp;</td>
362
		</tr>
363
		<tr>
364
			<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
365
		</tr>
366
		<tr>
367
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
368
			<td width="78%" class="vtable">
369
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
370
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
371
				<br /> <br />
372
				<input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
373
				&nbsp;(IP address)<span class="vexpl"><br /> Don't forget to add a firewall rule to permit IPv6 packets!</span>
374
			</td>
375
		</tr>
376
		<tr>
377
			<td width="22%" valign="top">&nbsp;</td>
378
			<td width="78%">
379
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
380
			</td>
381
		</tr>
382
		<tr>
383
			<td colspan="2" class="list" height="12">&nbsp;</td>
384
		</tr>
385
		<tr>
386
			<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
387
		</tr>
388
		<tr>
389
			<td width="22%" valign="top" class="vncell">Certificate</td>
390
			<td width="78%" class="vtable">
391
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
392
				<br />
393
				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.
394
			</td>
395
		</tr>
396
		<tr>
397
			<td width="22%" valign="top" class="vncell">Key</td>
398
			<td width="78%" class="vtable">
399
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
400
				<br />
401
				Paste an RSA private key in PEM format here.
402
			</td>
403
		</tr>
404
		<tr>
405
			<td width="22%" valign="top">&nbsp;</td>
406
			<td width="78%">
407
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
408
			</td>
409
		</tr>
410
		<tr>
411
			<td colspan="2" class="list" height="12">&nbsp;</td>
412
		</tr>
413
		<tr>
414
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
415
		</tr>
416

    
417
                <tr>
418
                  <td width="22%" valign="top" class="vncell">Device polling</td>
419
                  <td width="78%" class="vtable">
420
                    <input name="polling_enable" type="checkbox" id="polling_enable" value="yes" <?php if ($pconfig['polling_enable']) echo "checked"; ?>>
421
                    <strong>Use device polling</strong><br>
422
                                        Device polling is a technique that lets the system periodically poll network devices for new
423
                                        data instead of relying on interrupts. This can reduce CPU load and therefore increase
424
                                        throughput, at the expense of a slightly higher forwarding delay (the devices are polled 1000 times
425
                                        per second). Not all NICs support polling; see the pfSense homepage for a list of supported cards.
426
                  </td>
427
                </tr>
428
		
429
		<tr>
430
			<td width="22%" valign="top" class="vncell">Console menu </td>
431
			<td width="78%" class="vtable">
432
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
433
				<strong>Disable console menu</strong>
434
				<br />
435
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
436
			</td>
437
		</tr>
438
		<tr>
439
			<td valign="top" class="vncell">Firmware version check</td>
440
			<td class="vtable">
441
				<input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>  />
442
				<strong>Disable firmware version check</strong>
443
				<br />
444
				<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>
445
			</td>
446
		</tr>		
447
		<tr>
448
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
449
			<td width="78%" class="vtable">
450
				<select name="harddiskstandby" class="formfld">
451
<?php
452
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
453
					$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");
454
?>
455
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
456
<?php
457
					foreach ($sbvals as $sbval):
458
						list($min,$val) = explode(",", $sbval); ?>
459
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
460
<?php 				endforeach; ?>
461
				</select>
462
				<br />
463
				Puts the hard disk into standby mode when the selected amount of time after the last
464
				access has elapsed. <em>Do not set this for CF cards.</em>
465
			</td>
466
		</tr>
467
		<tr>
468
			<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
469
			<td width="78%" class="vtable">
470
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
471
				<strong>Disable webGUI anti-lockout rule</strong>
472
				<br />
473
				By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter 
474
				rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you 
475
				in, or you will lock yourself out!).
476
				<br />
477
				Hint: the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.
478
			</td>
479
		</tr>
480
		<tr>
481
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
482
			<td width="78%" class="vtable">
483
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
484
				<strong>Prefer old IPsec SAs</strong>
485
				<br />
486
				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.
487
			</td>
488
		</tr>		
489
		<tr>
490
			<td width="22%" valign="top">&nbsp;</td>
491
			<td width="78%">
492
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
493
			</td>
494
		</tr>
495
		<tr>
496
			<td colspan="2" class="list" height="12">&nbsp;</td>
497
		</tr>
498
		<tr>
499
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
500
		</tr>
501
		<tr>
502
			<td width="22%" valign="top" class="vncell">FTP Helper</td>
503
			<td width="78%" class="vtable">
504
				<input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if (isset($config['system']['disableftpproxy'])) echo "checked"; ?> onclick="enable_change(false)" />
505
				<strong class="vexpl">Disable the userland FTP-Proxy application</strong>
506
				<br />
507
			</td>
508
		</tr>
509
		<tr>
510
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
511
			<td width="78%" class="vtable">
512
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
513
				<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>
514
				<br />
515
			</td>
516
		</tr>
517
<!---
518
		<tr>
519
			<td width="22%" valign="top" class="vncell">Traffic Shaper Scheduler</td>
520
			<td width="78%" class="vtable">
521
				<select id="schedulertype" name="schedulertype" <?= $style ?>>
522
					<option value="priq"<?php if($pconfig['schedulertype'] == 'priq') echo " selected"; ?>>Priority based queueing</option>
523
					<option value="cbq"<?php if($pconfig['schedulertype'] == 'cbq') echo " selected"; ?>>Class based queueing</option>
524
					<option value="hfsc"<?php if($pconfig['schedulertype'] == 'hfsc') echo " selected"; ?>>Hierarchical Fair Service Curve queueing</option>
525
				</select>
526
				<br />
527
				<span class="vexpl"><b>Select which type of queueing you would like to use</b></span>
528
				<?php if (is_array($config['shaper']['queue']) > 0): ?>
529
				<script language="javascript" type="text/javascript">
530
					document.iform.schedulertype.disabled = 1;
531
				</script>
532
				<br />
533
				NOTE: This option is disabled since there are queues defined.
534
				<?php endif; ?>
535
			</td>
536
		</tr>
537
-->
538
		<tr>
539
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
540
			<td width="78%" class="vtable">
541
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
542
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
543
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
544
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
545
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
546
				</select>
547
				<br />
548
				<textarea cols="60" rows="2" id="info" name="info"style="border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
549
				<script language="javascript" type="text/javascript">
550
					update_description(document.forms[0].optimization.selectedIndex);
551
				</script>
552
				<br />
553
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
554
			</td>
555
		</tr>
556
		<tr>
557
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
558
			<td width="78%" class="vtable">
559
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
560
				<strong>Disable the firewalls filter altogether.</strong>
561
				<br />
562
				<span class="vexpl">Note:  This basically converts pfSense into a routing only platform!<br>
563
				                    Note:  This will turn off NAT!
564
				</span>
565
			</td>
566
		</tr>
567
		<tr>
568
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
569
			<td width="78%" class="vtable">
570
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
571
				<br />
572
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
573
				<br />
574
				<span class="vexpl">Note:  Leave this blank for the default of 10000</span>
575
			</td>
576
		</tr>
577
		<tr>
578
			<td width="22%" valign="top">&nbsp;</td>
579
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
580
		</tr>
581
		<tr>
582
			<td colspan="2" class="list" height="12">&nbsp;</td>
583
		</tr>
584
	</tbody>
585
</table>
586
</form>
587

    
588
<script language="JavaScript" type="text/javascript">
589
<!--
590
	enable_change(false);
591
	//enable_altfirmwareurl(false);
592
	//enable_altpkgconfigurl(false);
593
//-->
594
</script>
595

    
596
<?php include("fend.inc"); ?>
597

    
598
<?php
599

    
600
function auto_login($status) {
601
	$gettytab = file_get_contents("/etc/gettytab");
602
	$getty_split = split("\n", $gettytab);
603
	conf_mount_rw();
604
	$fd = fopen("/etc/gettytab", "w");
605
	foreach($getty_split as $gs) {
606
		if(stristr($gs, "cb:ce:ck:lc") == true) {
607
			if($status == true) {
608
				fwrite($fd, ":cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
609
			} else {
610
				fwrite($fd, ":al=root:cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
611
			}
612
		} else {
613
			fwrite($fd, "{$gs}\n");
614
		}
615
	}
616
	fclose($fd);
617
	conf_mount_ro();	
618
}
619

    
620
?>
621
</body>
622
</html>
(118-118/153)