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['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
|
49
|
$pconfig['powerd_enable'] = isset($config['system']['powerd_enable']);
|
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['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
|
73
|
$config['system']['powerd_enable'] = $_POST['powerd_enable'] ? true : false;
|
74
|
|
75
|
write_config();
|
76
|
|
77
|
$retval = 0;
|
78
|
$retval = filter_configure();
|
79
|
if(stristr($retval, "error") <> true)
|
80
|
$savemsg = get_std_save_message($retval);
|
81
|
else
|
82
|
$savemsg = $retval;
|
83
|
|
84
|
activate_powerd();
|
85
|
}
|
86
|
}
|
87
|
|
88
|
$pgtitle = array("System","Advanced: Miscellaneous");
|
89
|
include("head.inc");
|
90
|
|
91
|
?>
|
92
|
|
93
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
94
|
<?php
|
95
|
include("fbegin.inc");
|
96
|
if ($input_errors)
|
97
|
print_input_errors($input_errors);
|
98
|
if ($savemsg)
|
99
|
print_info_box($savemsg);
|
100
|
?>
|
101
|
<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
|
102
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
103
|
<tr>
|
104
|
<td>
|
105
|
<?php
|
106
|
$tab_array = array();
|
107
|
$tab_array[] = array("Admin Access", false, "system_advanced_admin.php");
|
108
|
$tab_array[] = array("Firewall / NAT", false, "system_advanced_firewall.php");
|
109
|
$tab_array[] = array("Networking", false, "system_advanced_network.php");
|
110
|
$tab_array[] = array("Miscellaneous", true, "system_advanced_misc.php");
|
111
|
$tab_array[] = array("System Tunables", false, "system_advanced_sysctl.php");
|
112
|
display_top_tabs($tab_array);
|
113
|
?>
|
114
|
</td>
|
115
|
</tr>
|
116
|
<tr>
|
117
|
<td id="mainarea">
|
118
|
<div class="tabcont">
|
119
|
<span class="vexpl">
|
120
|
<span class="red">
|
121
|
<strong>NOTE: </strong>
|
122
|
</span>
|
123
|
The options on this page are intended for use by advanced users only.
|
124
|
<br/>
|
125
|
</span>
|
126
|
<br/>
|
127
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
128
|
<tr>
|
129
|
<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
|
130
|
</tr>
|
131
|
<tr>
|
132
|
<td width="22%" valign="top" class="vncell">Load Balancing</td>
|
133
|
<td width="78%" class="vtable">
|
134
|
<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
|
135
|
<strong>Use sticky connections</strong><br/>
|
136
|
Successive connections will be redirected to the servers
|
137
|
in a round-robin manner with connections from the same
|
138
|
source being sent to the same web server. This "sticky
|
139
|
connection" will exist as long as there are states that
|
140
|
refer to this connection. Once the states expire, so will
|
141
|
the sticky connection. Further connections from that host
|
142
|
will be redirected to the next web server in the round
|
143
|
robin.
|
144
|
</td>
|
145
|
</tr>
|
146
|
<tr>
|
147
|
<td colspan="2" class="list" height="12"> </td>
|
148
|
</tr>
|
149
|
<tr>
|
150
|
<td colspan="2" valign="top" class="listtopic">Power savings</td>
|
151
|
</tr>
|
152
|
<tr>
|
153
|
<td width="22%" valign="top" class="vncell">PowerD</td>
|
154
|
<td width="78%" class="vtable">
|
155
|
<input name="powerd_enable" type="checkbox" id="powerd_enable" value="yes" <?php if ($pconfig['powerd_enable']) echo "checked"; ?> />
|
156
|
<strong>Use PowerD</strong><br/>
|
157
|
<br />
|
158
|
The powerd utility monitors the system state and sets various power control
|
159
|
options accordingly. It offers three modes (maximum, minimum, and
|
160
|
adaptive) that can be individually selected while on AC power or batteries.
|
161
|
The modes maximum, minimum, and adaptive may be abbreviated max,
|
162
|
min, adp. Maximum mode chooses the highest performance values. Minimum
|
163
|
mode selects the lowest performance values to get the most power savings.
|
164
|
Adaptive mode attempts to strike a balance by degrading performance when
|
165
|
the system appears idle and increasing it when the system is busy. It
|
166
|
offers a good balance between a small performance loss for greatly
|
167
|
increased power savings. The default mode for pfSense is adaptive.
|
168
|
</td>
|
169
|
</tr>
|
170
|
<tr>
|
171
|
<td colspan="2" class="list" height="12"> </td>
|
172
|
</tr>
|
173
|
<tr>
|
174
|
<td colspan="2" valign="top" class="listtopic">IP Security</td>
|
175
|
</tr>
|
176
|
<tr>
|
177
|
<td width="22%" valign="top" class="vncell">Security Assocications</td>
|
178
|
<td width="78%" class="vtable">
|
179
|
<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
|
180
|
<strong>Prefer older IPsec SAs</strong>
|
181
|
<br />
|
182
|
By default, if several SAs match, the newest one is
|
183
|
preferred if it's at least 30 seconds old. Select this
|
184
|
option to always prefer old SAs over new ones.
|
185
|
</td>
|
186
|
</tr>
|
187
|
<tr>
|
188
|
<td colspan="2" class="list" height="12"> </td>
|
189
|
</tr>
|
190
|
<?php if($g['platform'] == "pfSenseDISABLED"): ?>
|
191
|
<tr>
|
192
|
<td colspan="2" valign="top" class="listtopic">Hardware Settings</td>
|
193
|
</tr>
|
194
|
<tr>
|
195
|
<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
|
196
|
<td width="78%" class="vtable">
|
197
|
<select name="harddiskstandby" class="formselect">
|
198
|
<?php
|
199
|
## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
|
200
|
$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");
|
201
|
?>
|
202
|
<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
|
203
|
<?php
|
204
|
foreach ($sbvals as $sbval):
|
205
|
list($min,$val) = explode(",", $sbval);
|
206
|
?>
|
207
|
<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
|
208
|
<?php endforeach; ?>
|
209
|
</select>
|
210
|
<br/>
|
211
|
Puts the hard disk into standby mode when the selected amount of time after the last
|
212
|
access has elapsed. <em>Do not set this for CF cards.</em>
|
213
|
</td>
|
214
|
</tr>
|
215
|
<tr>
|
216
|
<td colspan="2" class="list" height="12"> </td>
|
217
|
</tr>
|
218
|
<?php endif; ?>
|
219
|
|
220
|
<tr>
|
221
|
<td width="22%" valign="top"> </td>
|
222
|
<td width="78%">
|
223
|
<input name="Submit" type="submit" class="formbtn" value="Save" />
|
224
|
</td>
|
225
|
</tr>
|
226
|
</table>
|
227
|
</div>
|
228
|
</td>
|
229
|
</tr>
|
230
|
</table>
|
231
|
</form>
|
232
|
|
233
|
<?php include("fend.inc"); ?>
|
234
|
</body>
|
235
|
</html>
|
236
|
|