Project

General

Profile

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

    
8
	Copyright (C) 2008 Shrew Soft Inc
9

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

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

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

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

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

    
36
##|+PRIV
37
##|*IDENT=page-system-advanced-misc
38
##|*NAME=System: Advanced: Miscellaneous page
39
##|*DESCR=Allow access to the 'System: Advanced: Miscellaneous' page.
40
##|*MATCH=system_advanced.php*
41
##|-PRIV
42

    
43

    
44
require("guiconfig.inc");
45

    
46
$pconfig['harddiskstandby'] = $config['system']['harddiskstandby'];
47
$pconfig['lb_use_sticky'] = isset($config['system']['lb_use_sticky']);
48
$pconfig['shapertype'] = $config['system']['shapertype'];
49
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
50

    
51
if ($_POST) {
52

    
53
    unset($input_errors);
54
    $pconfig = $_POST;
55

    
56
	ob_flush();
57
	flush();
58

    
59
	if (!$input_errors) {
60

    
61
		if($_POST['harddiskstandby'] <> "") {
62
			$config['system']['harddiskstandby'] = $_POST['harddiskstandby'];
63
			system_set_harddisk_standby();
64
		} else
65
			unset($config['system']['harddiskstandby']);
66

    
67
		if($_POST['lb_use_sticky'] == "yes")
68
			$config['system']['lb_use_sticky'] = true;
69
		else
70
			unset($config['system']['lb_use_sticky']);
71

    
72
		$config['system']['shapertype'] = $_POST['shapertype'];
73

    
74
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
75

    
76
		write_config();
77

    
78
		$retval = 0;
79
		config_lock();
80
		$retval = filter_configure();
81
		if(stristr($retval, "error") <> true)
82
		    $savemsg = get_std_save_message($retval);
83
		else
84
		    $savemsg = $retval;
85
		config_unlock();
86
	}
87
}
88

    
89
$pgtitle = array("System","Advanced: Miscellaneous");
90
include("head.inc");
91

    
92
?>
93

    
94
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
95
<?php
96
	include("fbegin.inc");
97
	if ($input_errors)
98
		print_input_errors($input_errors);
99
	if ($savemsg)
100
		print_info_box($savemsg);
101
?>
102
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
103
		<tr>
104
			<td>
105
				<span class="vexpl">
106
					<span class="red">
107
						<strong>Note:</strong>
108
					</span>
109
					the options on this page are intended for use by advanced users only.
110
					<br/>
111
				</span>
112
				<br/>
113
			</td>
114
		</tr>
115
		<tr>
116
			<td class="tabnavtbl">
117
				<ul id="tabnav">
118
				<?php
119
					$tab_array = array();
120
					$tab_array[] = array("Admin Access", false, "system_advanced_admin.php");
121
					$tab_array[] = array("Firewall / NAT", false, "system_advanced_firewall.php");
122
					$tab_array[] = array("Networking", false, "system_advanced_network.php");
123
					$tab_array[] = array("Miscellaneous", true, "system_advanced_misc.php");
124
					$tab_array[] = array("System Tunables", false, "system_advanced_sysctl.php");
125
					display_top_tabs($tab_array);
126
				?>
127
				</ul>
128
			</td>
129
		</tr>
130
		<tr>
131
			<td class="tabcont">
132
				<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
133
					<table width="100%" border="0" cellpadding="6" cellspacing="0">
134

    
135
						<tr>
136
							<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
137
						</tr>
138
						<tr>
139
							<td width="22%" valign="top" class="vncell">Load Balancing</td>
140
							<td width="78%" class="vtable">
141
								<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
142
								<strong>Use sticky connections</strong><br/>
143
								Successive connections will be redirected to the servers
144
								in a round-robin manner with connections from the same
145
								source being sent to the same web server. This "sticky
146
								connection" will exist as long as there are states that
147
								refer to this connection. Once the states expire, so will
148
								the sticky connection. Further connections from that host
149
								will be redirected to the next web server in the round
150
								robin.
151
							</td>
152
						</tr>
153
						<tr>
154
							<td colspan="2" class="list" height="12">&nbsp;</td>
155
						</tr>
156
						<?php
157
						/*
158
						<tr>
159
							<td colspan="2" valign="top" class="listtopic">Traffic Shaper</td>
160
						</tr>
161
						<tr>
162
							<td width="22%" valign="top" class="vncell">Traffic shaper type</td>
163
							<td width="78%" class="vtable">
164
								<select name="shapertype" class="formselect">
165
									<option value="pfSense"<?php if($pconfig['shapertype'] == 'pfSense') echo " selected"; ?>><?= $g['product_name'] ?> (ALTQ)</option>
166
									<option value="m0n0"<?php if($pconfig['shapertype'] == 'm0n0') echo " selected"; ?>>M0n0wall (dummynet)</option>
167
								</select>
168
							</td>
169
						</tr>
170
						<tr>
171
							<td colspan="2" class="list" height="12">&nbsp;</td>
172
						</tr>
173
						*/
174
						?>
175
						<tr>
176
							<td colspan="2" valign="top" class="listtopic">IP Security</td>
177
						</tr>
178
						<tr>
179
							<td width="22%" valign="top" class="vncell">IPsec SA preferral</td>
180
							<td width="78%" class="vtable">
181
								<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
182
								<strong>Prefer older IPsec SAs</strong>
183
								<br />
184
								By default, if several SAs match, the newest one is
185
								preferred if it's at least 30 seconds old. Select this
186
								option to always prefer old SAs over new ones.
187
							</td>
188
						</tr>
189
						<tr>
190
							<td colspan="2" class="list" height="12">&nbsp;</td>
191
						</tr>
192
						<?php if($g['platform'] == "pfSenseDISABLED"): ?>
193
						<tr>
194
							<td colspan="2" valign="top" class="listtopic">Hardware Settings</td>
195
						</tr>
196
						<tr>
197
							<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
198
							<td width="78%" class="vtable">
199
								<select name="harddiskstandby" class="formselect">
200
									<?php
201
									 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
202
										$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");
203
									?>
204
									<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
205
									<?php
206
										foreach ($sbvals as $sbval):
207
											list($min,$val) = explode(",", $sbval);
208
									?>
209
									<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
210
									<?php endforeach; ?>
211
								</select>
212
								<br/>
213
								Puts the hard disk into standby mode when the selected amount of time after the last
214
								access has elapsed. <em>Do not set this for CF cards.</em>
215
							</td>
216
						</tr>
217
						<tr>
218
							<td colspan="2" class="list" height="12">&nbsp;</td>
219
						</tr>
220
						<?php endif; ?>
221

    
222
						<tr>
223
							<td width="22%" valign="top">&nbsp;</td>
224
							<td width="78%">
225
								<input name="Submit" type="submit" class="formbtn" value="Save" />
226
							</td>
227
						</tr>
228
					</table>
229
				</form>
230
			</td>
231
		</tr>
232
	</table>
233

    
234
<?php include("fend.inc"); ?>
235
</body>
236
</html>
237

    
(167-167/211)