Project

General

Profile

Download (23.2 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['sharednet'] = $config['system']['sharednet'];
57

    
58
if ($_POST) {
59

    
60
	unset($input_errors);
61
	$pconfig = $_POST;
62

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

    
106
		if($_POST['sharednet'] == "yes") {
107
			$config['system']['sharednet'] = true;
108
			system_disable_arp_wrong_if();
109
		} else {
110
			unset($config['system']['sharednet']);
111
			system_enable_arp_wrong_if();
112
		}		
113

    
114
		if($_POST['disableftpproxy'] == "yes") {
115
			$config['system']['disableftpproxy'] = "enabled";
116
			unset($config['system']['rfc959workaround']);
117
			system_start_ftp_helpers();
118
		} else {
119
			unset($config['system']['disableftpproxy']);
120
			system_start_ftp_helpers();
121
		}
122
		if($_POST['rfc959workaround'] == "yes")
123
			$config['system']['rfc959workaround'] = "enabled";
124
		else
125
			unset($config['system']['rfc959workaround']);
126

    
127
		if($_POST['ipv6nat_enable'] == "yes") {
128
			$config['diag']['ipv6nat']['enable'] = true;
129
			$config['diag']['ipv6nat']['ipaddr'] = $_POST['ipv6nat_ipaddr'];
130
		} else {
131
			unset($config['diag']['ipv6nat']['enable']);
132
			unset($config['diag']['ipv6nat']['ipaddr']);
133
		}
134
		$oldcert = $config['system']['webgui']['certificate'];
135
		$oldkey = $config['system']['webgui']['private-key'];
136
		$config['system']['webgui']['certificate'] = base64_encode($_POST['cert']);
137
		$config['system']['webgui']['private-key'] = base64_encode($_POST['key']);
138
		if($_POST['disableconsolemenu'] == "yes") {
139
			$config['system']['disableconsolemenu'] = true;
140
			auto_login(true);
141
		} else {
142
			unset($config['system']['disableconsolemenu']);
143
			auto_login(false);
144
		}
145
		unset($config['system']['webgui']['expanddiags']);
146
		$config['system']['optimization'] = $_POST['optimization'];
147
		
148
		if($_POST['disablefirmwarecheck'] == "yes")
149
			$config['system']['disablefirmwarecheck'] = true;
150
		else
151
			unset($config['system']['disablefirmwarecheck']);
152

    
153
		if ($_POST['enableserial'] == "yes")
154
			$config['system']['enableserial'] = true;
155
		else
156
			unset($config['system']['enableserial']);
157

    
158
		if($_POST['harddiskstandby'] <> "") {
159
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
160
			system_set_harddisk_standby();
161
		} else
162
			unset($config['system']['harddiskstandby']);
163

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

    
169
		/* Firewall and ALTQ options */
170
		$config['shaper']['schedulertype'] = $_POST['schedulertype'];
171
		$config['system']['maximumstates'] = $_POST['maximumstates'];
172

    
173
		if($_POST['enablesshd'] == "yes") {
174
			$config['system']['enablesshd'] = $_POST['enablesshd'];
175
		} else {
176
			unset($config['system']['enablesshd']);
177
		}
178

    
179
                $config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
180
	
181
		/* pfSense themes */
182
		$config['theme'] = $_POST['theme'];
183

    
184
		write_config();
185

    
186
		if (($config['system']['webgui']['certificate'] != $oldcert)
187
				|| ($config['system']['webgui']['private-key'] != $oldkey)) {
188
			system_webgui_start();
189
		}
190

    
191
			
192
		$retval = 0;
193
		config_lock();
194
		$retval = filter_configure();
195
		if(stristr($retval, "error") <> true)
196
		    $savemsg = get_std_save_message($retval);
197
		else
198
		    $savemsg = $retval;
199
		$retval |= interfaces_optional_configure();
200
		config_unlock();
201
		
202
		$etc_ttys  = return_filename_as_array("/etc/ttys");
203
		$boot_loader_rc = return_filename_as_array("/boot/loader.rc");
204
		
205
		conf_mount_rw();
206
		
207
		$fout = fopen("/etc/ttys","w");
208
		if(!$fout) {
209
			echo "Cannot open /etc/ttys for writing.  Floppy inserted?\n";	
210
		} else {		
211
			foreach($etc_ttys as $tty) {
212
				if(stristr($tty,"ttyv0") <> true) {
213
					if($tty <> "")
214
						fwrite($fout, $tty . "\n");				
215
				}
216
			}
217
			if(isset($pconfig['enableserial']))
218
				fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n");
219
			fclose($fout);		
220
		}
221
		
222
		$fout = fopen("/boot/loader.rc","w");
223
		if(!is_array($boot_loader_rc))
224
			$boot_loader_rc = array();
225
		foreach($boot_loader_rc as $blrc) {
226
			if(stristr($blrc,"comconsole") <> true) {
227
				fwrite($fout, $blrc . "\n");				
228
			}
229
		}
230
		if(isset($pconfig['enableserial']))
231
			fwrite($fout, "set console=comconsole\n");
232
		fclose($fout);
233
		
234
		mwexec("/etc/sshd");
235
		
236
		conf_mount_ro();
237
	}
238
}
239

    
240
$pgtitle = "System: Advanced functions";
241
include("head.inc");
242

    
243
?>
244

    
245
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
246

    
247
<?php include("fbegin.inc"); ?>
248

    
249
<p class="pgtitle"><?=$pgtitle?></p>
250

    
251
<form action="system_advanced.php" method="post" name="iform" id="iform">
252
<?php if ($input_errors) print_input_errors($input_errors); ?>
253
<?php if ($savemsg) print_info_box($savemsg); ?>
254
<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>
255
<br />
256

    
257
<table width="100%" border="0" cellpadding="6" cellspacing="0">
258
	<tbody>
259
		<?php if($g['platform'] == "pfSense" || $g['platform'] == "cdrom"): ?>
260
		<tr>
261
			<td colspan="2" valign="top" class="listtopic">Enable Serial Console</td>
262
		</tr>
263
		<tr>
264
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
265
			<td width="78%" class="vtable">
266
				<input name="enableserial" type="checkbox" id="enableserial" value="yes" <?php if (isset($pconfig['enableserial'])) echo "checked"; ?> onclick="enable_change(false)" />
267
				<strong>This will enable the first serial port with 9600/8/N/1</strong>
268
			</td>
269
		</tr>
270
		<tr>
271
			<td width="22%" valign="top">&nbsp;</td>
272
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
273
		</tr>
274
		</tr>
275
		<tr>
276
			<td colspan="2" class="list" height="12"></td>
277
		</tr>		
278
		<?php endif ?>
279
		<tr>
280
			<td colspan="2" valign="top" class="listtopic">Secure Shell</td>
281
		</tr>
282
		<tr>
283
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
284
			<td width="78%" class="vtable">
285
				<input name="enablesshd" type="checkbox" id="enablesshd" value="yes" <?php if (isset($pconfig['enablesshd'])) echo "checked"; ?> onclick="enable_change(false)" />
286
				<strong>Enable Secure Shell</strong>
287
			</td>
288
		</tr>
289
		<tr>
290
			<td width="22%" valign="top">&nbsp;</td>
291
			<td width="78%">
292
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
293
			</td>
294
		</tr>
295
		<tr>
296
			<td colspan="2" class="list" height="12">&nbsp;</td>
297
		</tr>		
298
		<tr>
299
			<td colspan="2" valign="top" class="listtopic">Shared Physical Network</td>
300
		</tr>
301
		<tr>
302
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
303
			<td width="78%" class="vtable">
304
				<input name="sharednet" type="checkbox" id="sharednet" value="yes" <?php if (isset($pconfig['sharednet'])) echo "checked"; ?> onclick="enable_change(false)" />
305
				<strong>This will suppress ARP messages when interfaces share the same physical network</strong>
306
			</td>
307
		</tr>
308
		<tr>
309
			<td width="22%" valign="top">&nbsp;</td>
310
			<td width="78%">
311
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
312
			</td>
313
		</tr>
314
		<tr>
315
			<td colspan="2" class="list" height="12">&nbsp;</td>
316
		</tr>	
317
		<tr>
318
			<td colspan="2" valign="top" class="listtopic">Theme</td>
319
		</tr>
320
		<tr>
321
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
322
			<td width="78%" class="vtable">
323
			    <select name="theme">
324
<?php
325
				$files = return_dir_as_array("/usr/local/www/themes/");
326
				foreach($files as $f) {
327
					if ( (substr($f, 0, 1) == "_") && !isset($config['system']['developer']) ) continue;
328
					if($f == "CVS") continue;
329
					$selected = "";
330
					if($f == $config['theme'])
331
						$selected = " SELECTED";
332
					if($config['theme'] == "" and $f == "pfsense")
333
						$selceted = " SELECTED";
334
					echo "\t\t\t\t\t"."<option{$selected}>{$f}</option>\n";
335
				}
336
?>
337
				</select>
338
				<strong>This will change the look and feel of pfSense</strong>
339
			</td>
340
		</tr>
341
		<tr>
342
			<td width="22%" valign="top">&nbsp;</td>
343
			<td width="78%">
344
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
345
			</td>
346
		</tr>
347
		<tr>
348
			<td colspan="2" class="list" height="12">&nbsp;</td>
349
		</tr>
350
		<tr>
351
			<td colspan="2" valign="top" class="listtopic">IPv6 tunneling</td>
352
		</tr>
353
		<tr>
354
			<td width="22%" valign="top" class="vncell">&nbsp;</td>
355
			<td width="78%" class="vtable">
356
				<input name="ipv6nat_enable" type="checkbox" id="ipv6nat_enable" value="yes" <?php if ($pconfig['ipv6nat_enable']) echo "checked"; ?> onclick="enable_change(false)" />
357
				<strong>NAT encapsulated IPv6 packets (IP protocol 41/RFC2893) to:</strong>
358
				<br /> <br />
359
				<input name="ipv6nat_ipaddr" type="text" class="formfld" id="ipv6nat_ipaddr" size="20" value="<?=htmlspecialchars($pconfig['ipv6nat_ipaddr']);?>" />
360
				&nbsp;(IP address)<span class="vexpl"><br /> Don't forget to add a firewall rule to permit IPv6 packets!</span>
361
			</td>
362
		</tr>
363
		<tr>
364
			<td width="22%" valign="top">&nbsp;</td>
365
			<td width="78%">
366
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
367
			</td>
368
		</tr>
369
		<tr>
370
			<td colspan="2" class="list" height="12">&nbsp;</td>
371
		</tr>
372
		<tr>
373
			<td colspan="2" valign="top" class="listtopic">webGUI SSL certificate/key</td>
374
		</tr>
375
		<tr>
376
			<td width="22%" valign="top" class="vncell">Certificate</td>
377
			<td width="78%" class="vtable">
378
				<textarea name="cert" cols="65" rows="7" id="cert" class="formpre"><?=htmlspecialchars($pconfig['cert']);?></textarea>
379
				<br />
380
				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.
381
			</td>
382
		</tr>
383
		<tr>
384
			<td width="22%" valign="top" class="vncell">Key</td>
385
			<td width="78%" class="vtable">
386
				<textarea name="key" cols="65" rows="7" id="key" class="formpre"><?=htmlspecialchars($pconfig['key']);?></textarea>
387
				<br />
388
				Paste an RSA private key in PEM format here.
389
			</td>
390
		</tr>
391
		<tr>
392
			<td width="22%" valign="top">&nbsp;</td>
393
			<td width="78%">
394
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
395
			</td>
396
		</tr>
397
		<tr>
398
			<td colspan="2" class="list" height="12">&nbsp;</td>
399
		</tr>
400
		<tr>
401
			<td colspan="2" valign="top" class="listtopic">Miscellaneous</td>
402
		</tr>
403
		<tr>
404
			<td width="22%" valign="top" class="vncell">Console menu </td>
405
			<td width="78%" class="vtable">
406
				<input name="disableconsolemenu" type="checkbox" id="disableconsolemenu" value="yes" <?php if ($pconfig['disableconsolemenu']) echo "checked"; ?>  />
407
				<strong>Disable console menu</strong>
408
				<br />
409
				<span class="vexpl">Changes to this option will take effect after a reboot.</span>
410
			</td>
411
		</tr>
412
		<tr>
413
			<td valign="top" class="vncell">Firmware version check</td>
414
			<td class="vtable">
415
				<input name="disablefirmwarecheck" type="checkbox" id="disablefirmwarecheck" value="yes" <?php if ($pconfig['disablefirmwarecheck']) echo "checked"; ?>  />
416
				<strong>Disable firmware version check</strong>
417
				<br />
418
				<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>
419
			</td>
420
		</tr>		
421
		<tr>
422
			<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
423
			<td width="78%" class="vtable">
424
				<select name="harddiskstandby" class="formfld">
425
<?php
426
				 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
427
					$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");
428
?>
429
					<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
430
<?php
431
					foreach ($sbvals as $sbval):
432
						list($min,$val) = explode(",", $sbval); ?>
433
					<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
434
<?php 				endforeach; ?>
435
				</select>
436
				<br />
437
				Puts the hard disk into standby mode when the selected amount of time after the last
438
				access has elapsed. <em>Do not set this for CF cards.</em>
439
			</td>
440
		</tr>
441
		<tr>
442
			<td width="22%" valign="top" class="vncell">webGUI anti-lockout</td>
443
			<td width="78%" class="vtable">
444
				<input name="noantilockout" type="checkbox" id="noantilockout" value="yes" <?php if ($pconfig['noantilockout']) echo "checked"; ?> />
445
				<strong>Disable webGUI anti-lockout rule</strong>
446
				<br />
447
				By default, access to the webGUI on the LAN interface is always permitted, regardless of the user-defined filter 
448
				rule set. Enable this feature to control webGUI access (make sure to have a filter rule in place that allows you 
449
				in, or you will lock yourself out!).
450
				<br />
451
				Hint: the &quot;set LAN IP address&quot; option in the console menu  resets this setting as well.
452
			</td>
453
		</tr>
454
		<tr>
455
			<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
456
			<td width="78%" class="vtable">
457
				<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
458
				<strong>Prefer old IPsec SAs</strong>
459
				<br />
460
				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.
461
			</td>
462
		</tr>		
463
		<tr>
464
			<td width="22%" valign="top">&nbsp;</td>
465
			<td width="78%">
466
				<input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" />
467
			</td>
468
		</tr>
469
		<tr>
470
			<td colspan="2" class="list" height="12">&nbsp;</td>
471
		</tr>
472
		<tr>
473
			<td colspan="2" valign="top" class="listtopic">Traffic Shaper and Firewall Advanced</td>
474
		</tr>
475
		<tr>
476
			<td width="22%" valign="top" class="vncell">FTP Helper</td>
477
			<td width="78%" class="vtable">
478
				<input name="disableftpproxy" type="checkbox" id="disableftpproxy" value="yes" <?php if (isset($config['system']['disableftpproxy'])) echo "checked"; ?> onclick="enable_change(false)" />
479
				<strong class="vexpl">Disable the userland FTP-Proxy application</strong>
480
				<br />
481
			</td>
482
		</tr>
483
		<tr>
484
			<td width="22%" valign="top" class="vncell">FTP RFC 959 data port violation workaround</td>
485
			<td width="78%" class="vtable">
486
				<input name="rfc959workaround" type="checkbox" id="rfc959workaround" value="yes" <?php if (isset($config['system']['rfc959workaround'])) echo "checked"; ?> onclick="enable_change(false)" />
487
				<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>
488
				<br />
489
			</td>
490
		</tr>
491
		<tr>
492
			<td width="22%" valign="top" class="vncell">Traffic Shaper Scheduler</td>
493
			<td width="78%" class="vtable">
494
				<select id="schedulertype" name="schedulertype" <?= $style ?>>
495
					<option value="priq"<?php if($pconfig['schedulertype'] == 'priq') echo " selected"; ?>>Priority based queueing</option>
496
					<option value="cbq"<?php if($pconfig['schedulertype'] == 'cbq') echo " selected"; ?>>Class based queueing</option>
497
					<option value="hfsc"<?php if($pconfig['schedulertype'] == 'hfsc') echo " selected"; ?>>Hierarchical Fair Service Curve queueing</option>
498
				</select>
499
				<br />
500
				<span class="vexpl"><b>Select which type of queueing you would like to use</b></span>
501
				<?php if (is_array($config['shaper']['queue']) > 0): ?>
502
				<script language="javascript" type="text/javascript">
503
					document.iform.schedulertype.disabled = 1;
504
				</script>
505
				<br />
506
				NOTE: This option is disabled since there are queues defined.
507
				<?php endif; ?>
508
			</td>
509
		</tr>
510
		<tr>
511
			<td width="22%" valign="top" class="vncell">Firewall Optimization Options</td>
512
			<td width="78%" class="vtable">
513
				<select onChange="update_description(this.selectedIndex);" name="optimization" id="optimization">
514
					<option value="normal"<?php if($config['system']['optimization']=="normal") echo " selected"; ?>>normal</option>
515
					<option value="high-latency"<?php if($config['system']['optimization']=="high-latency") echo " selected"; ?>>high-latency</option>
516
					<option value="aggressive"<?php if($config['system']['optimization']=="aggressive") echo " selected"; ?>>aggressive</option>
517
					<option value="conservative"<?php if($config['system']['optimization']=="conservative") echo " selected"; ?>>conservative</option>
518
				</select>
519
				<br />
520
				<textarea cols="60" rows="2" id="info" name="info"style="border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;"></textarea>
521
				<script language="javascript" type="text/javascript">
522
					update_description(document.forms[0].optimization.selectedIndex);
523
				</script>
524
				<br />
525
				<span class="vexpl"><b>Select which type of state table optimization your would like to use</b></span>
526
			</td>
527
		</tr>
528
		<tr>
529
			<td width="22%" valign="top" class="vncell">Disable Firewall</td>
530
			<td width="78%" class="vtable">
531
				<input name="disablefilter" type="checkbox" id="disablefilter" value="yes" <?php if (isset($config['system']['disablefilter'])) echo "checked"; ?> onclick="enable_change(false)" />
532
				<strong>Disable the firewalls filter altogether.</strong>
533
				<br />
534
				<span class="vexpl">Note:  This basically converts pfSense into a routing only platform!<br>
535
				                    Note:  This will turn off NAT!
536
				</span>
537
			</td>
538
		</tr>
539
		<tr>
540
			<td width="22%" valign="top" class="vncell">Firewall Maximum States</td>
541
			<td width="78%" class="vtable">
542
				<input name="maximumstates" type="text" id="maximumstates" value="<?php echo $pconfig['maximumstates']; ?>" onclick="enable_change(false)" />
543
				<br />
544
				<strong>Maximum number of connections to hold in the firewall state table.</strong>
545
				<br />
546
				<span class="vexpl">Note:  Leave this blank for the default of 10000</span>
547
			</td>
548
		</tr>
549
		<tr>
550
			<td width="22%" valign="top">&nbsp;</td>
551
			<td width="78%"><input name="Submit" type="submit" class="formbtn" value="Save" onclick="enable_change(true)" /></td>
552
		</tr>
553
		<tr>
554
			<td colspan="2" class="list" height="12">&nbsp;</td>
555
		</tr>
556
	</tbody>
557
</table>
558
</form>
559

    
560
<script language="JavaScript" type="text/javascript">
561
<!--
562
	enable_change(false);
563
	//enable_altfirmwareurl(false);
564
	//enable_altpkgconfigurl(false);
565
//-->
566
</script>
567

    
568
<?php include("fend.inc"); ?>
569

    
570
<?php
571

    
572
function auto_login($status) {
573
	$gettytab = file_get_contents("/etc/gettytab");
574
	$getty_split = split("\n", $gettytab);
575
	conf_mount_rw();
576
	$fd = fopen("/etc/gettytab", "w");
577
	foreach($getty_split as $gs) {
578
		if(stristr($gs, "cb:ce:ck:lc") == true) {
579
			if($status == true) {
580
				fwrite($fd, ":cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
581
			} else {
582
				fwrite($fd, ":al=root:cb:ce:ck:lc:fd#1000:im=\\r\\n%s/%m (%h) (%t)\\r\\n\\r\\n:sp#1200:\\\n");
583
			}
584
		} else {
585
			fwrite($fd, "{$gs}\n");
586
		}
587
	}
588
	fclose($fd);
589
	conf_mount_ro();	
590
}
591

    
592
?>
593
</body>
594
</html>
(118-118/147)