Project

General

Profile

Download (7.28 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
	<form action="system_advanced_misc.php" method="post" name="iform" id="iform">
103
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
104
			<tr>
105
				<td>
106
					<?php
107
						$tab_array = array();
108
						$tab_array[] = array("Admin Access", false, "system_advanced_admin.php");
109
						$tab_array[] = array("Firewall / NAT", false, "system_advanced_firewall.php");
110
						$tab_array[] = array("Networking", false, "system_advanced_network.php");
111
						$tab_array[] = array("Miscellaneous", true, "system_advanced_misc.php");
112
						$tab_array[] = array("System Tunables", false, "system_advanced_sysctl.php");
113
						display_top_tabs($tab_array);
114
					?>
115
				</td>
116
			</tr>
117
			<tr>
118
				<td id="mainarea">
119
					<div class="tabcont">
120
						<span class="vexpl">
121
							<span class="red">
122
								<strong>NOTE:&nbsp</strong>
123
							</span>
124
							The options on this page are intended for use by advanced users only.
125
							<br/>
126
						</span>
127
						<br/>
128
						<table width="100%" border="0" cellpadding="6" cellspacing="0">
129
							<tr>
130
								<td colspan="2" valign="top" class="listtopic">Load Balancing</td>
131
							</tr>
132
							<tr>
133
								<td width="22%" valign="top" class="vncell">Load Balancing</td>
134
								<td width="78%" class="vtable">
135
									<input name="lb_use_sticky" type="checkbox" id="lb_use_sticky" value="yes" <?php if ($pconfig['lb_use_sticky']) echo "checked=\"checked\""; ?> />
136
									<strong>Use sticky connections</strong><br/>
137
									Successive connections will be redirected to the servers
138
									in a round-robin manner with connections from the same
139
									source being sent to the same web server. This "sticky
140
									connection" will exist as long as there are states that
141
									refer to this connection. Once the states expire, so will
142
									the sticky connection. Further connections from that host
143
									will be redirected to the next web server in the round
144
									robin.
145
								</td>
146
							</tr>
147
							<tr>
148
								<td colspan="2" class="list" height="12">&nbsp;</td>
149
							</tr>
150
							<tr>
151
								<td colspan="2" valign="top" class="listtopic">IP Security</td>
152
							</tr>
153
							<tr>
154
								<td width="22%" valign="top" class="vncell">Security Assocications</td>
155
								<td width="78%" class="vtable">
156
									<input name="preferoldsa_enable" type="checkbox" id="preferoldsa_enable" value="yes" <?php if ($pconfig['preferoldsa_enable']) echo "checked"; ?> />
157
									<strong>Prefer older IPsec SAs</strong>
158
									<br />
159
									By default, if several SAs match, the newest one is
160
									preferred if it's at least 30 seconds old. Select this
161
									option to always prefer old SAs over new ones.
162
								</td>
163
							</tr>
164
							<tr>
165
								<td colspan="2" class="list" height="12">&nbsp;</td>
166
							</tr>
167
							<?php if($g['platform'] == "pfSenseDISABLED"): ?>
168
							<tr>
169
								<td colspan="2" valign="top" class="listtopic">Hardware Settings</td>
170
							</tr>
171
							<tr>
172
								<td width="22%" valign="top" class="vncell">Hard disk standby time </td>
173
								<td width="78%" class="vtable">
174
									<select name="harddiskstandby" class="formselect">
175
										<?php
176
										 	## Values from ATA-2 http://www.t13.org/project/d0948r3-ATA-2.pdf (Page 66)
177
											$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");
178
										?>
179
										<option value="" <?php if(!$pconfig['harddiskstandby']) echo('selected');?>>Always on</option>
180
										<?php
181
											foreach ($sbvals as $sbval):
182
												list($min,$val) = explode(",", $sbval);
183
										?>
184
										<option value="<?=$val;?>" <?php if($pconfig['harddiskstandby'] == $val) echo('selected');?>><?=$min;?> minutes</option>
185
										<?php endforeach; ?>
186
									</select>
187
									<br/>
188
									Puts the hard disk into standby mode when the selected amount of time after the last
189
									access has elapsed. <em>Do not set this for CF cards.</em>
190
								</td>
191
							</tr>
192
							<tr>
193
								<td colspan="2" class="list" height="12">&nbsp;</td>
194
							</tr>
195
							<?php endif; ?>
196

    
197
							<tr>
198
								<td width="22%" valign="top">&nbsp;</td>
199
								<td width="78%">
200
									<input name="Submit" type="submit" class="formbtn" value="Save" />
201
								</td>
202
							</tr>
203
						</table>
204
					</div>
205
				</td>
206
			</tr>
207
		</table>
208
	</form>
209

    
210
<?php include("fend.inc"); ?>
211
</body>
212
</html>
213

    
(166-166/210)