Project

General

Profile

Download (23.1 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['system']['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['system']['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
					fwrite($fout, $tty . "\n");				
214
				}
215
			}
216
			if(isset($pconfig['enableserial']))
217
				fwrite($fout, "ttyv0\t\"/usr/libexec/getty Pc\"\tcons25\t\ton\tsecure\n");
218
			fclose($fout);		
219
		}
220
		
221
		$fout = fopen("/boot/loader.rc","w");
222
		if(!is_array($boot_loader_rc))
223
			$boot_loader_rc = array();
224
		foreach($boot_loader_rc as $blrc) {
225
			if(stristr($blrc,"comconsole") <> true) {
226
				fwrite($fout, $blrc . "\n");				
227
			}
228
		}
229
		if(isset($pconfig['enableserial']))
230
			fwrite($fout, "set console=comconsole\n");
231
		fclose($fout);
232
		
233
		mwexec("/etc/sshd");
234
		
235
		conf_mount_ro();
236
	}
237
}
238

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

    
242
?>
243

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

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

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

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

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

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

    
565
<?php include("fend.inc"); ?>
566

    
567
<?php
568

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

    
589
?>
590
</body>
591
</html>
(117-117/146)