Project

General

Profile

Download (7.16 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['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
49

    
50
if ($_POST) {
51

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

    
55
	ob_flush();
56
	flush();
57

    
58
	if (!$input_errors) {
59

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

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

    
71
		$config['ipsec']['preferoldsa'] = $_POST['preferoldsa_enable'] ? true : false;
72

    
73
		write_config();
74

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

    
86
$pgtitle = array("System","Advanced: Miscellaneous");
87
include("head.inc");
88

    
89
?>
90

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

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

    
207
<?php include("fend.inc"); ?>
208
</body>
209
</html>
210

    
(167-167/212)