1 |
0b2e3c64
|
Colin Smith
|
<?php
|
2 |
|
|
/* $Id$ */
|
3 |
|
|
/*
|
4 |
2094568a
|
Colin Smith
|
system_firmware_settings.php
|
5 |
0b2e3c64
|
Colin Smith
|
part of pfSense
|
6 |
2094568a
|
Colin Smith
|
Copyright (C) 2005 Colin Smith
|
7 |
0b2e3c64
|
Colin Smith
|
|
8 |
|
|
Redistribution and use in source and binary forms, with or without
|
9 |
|
|
modification, are permitted provided that the following conditions are met:
|
10 |
|
|
|
11 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
12 |
|
|
this list of conditions and the following disclaimer.
|
13 |
|
|
|
14 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
15 |
|
|
notice, this list of conditions and the following disclaimer in the
|
16 |
|
|
documentation and/or other materials provided with the distribution.
|
17 |
|
|
|
18 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
19 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
21 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
22 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
23 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
24 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
25 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
26 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
9b7d7aa9
|
Scott Ullrich
|
Header("Location: system_firmware.php");
|
31 |
|
|
exit;
|
32 |
|
|
|
33 |
0b2e3c64
|
Colin Smith
|
require("guiconfig.inc");
|
34 |
|
|
|
35 |
|
|
if ($_POST) {
|
36 |
9471afe1
|
Colin Smith
|
/* input validation */
|
37 |
|
|
if($_POST['firmwareurl'] && !is_string($_POST['firmwareurl'])) {
|
38 |
|
|
$input_errors[] = "The base XMLRPC URL must be a string.";
|
39 |
|
|
}
|
40 |
|
|
if($_POST['firmwarepath'] && !is_string($_POST['firmwarepath'])) {
|
41 |
|
|
$input_errors[] = "The XMLRPC path must be a string.";
|
42 |
|
|
}
|
43 |
|
|
if (!$input_errors) {
|
44 |
|
|
$config['system']['firmware']['branch'] = $_POST['branch'];
|
45 |
|
|
if($_POST['alturlenable'] == "yes") {
|
46 |
|
|
$config['system']['firmware']['alturl']['enable'] = "";
|
47 |
|
|
$config['system']['firmware']['alturl']['firmwareurl'] = $_POST['firmwareurl'];
|
48 |
|
|
$config['system']['firmware']['alturl']['firmwarepath'] = $_POST['firmwarepath'];
|
49 |
|
|
} else {
|
50 |
|
|
unset($config['system']['firmware']['alturl']['enable']);
|
51 |
|
|
}
|
52 |
|
|
write_config();
|
53 |
|
|
}
|
54 |
0b2e3c64
|
Colin Smith
|
}
|
55 |
|
|
|
56 |
|
|
$curcfg = $config['system']['firmware'];
|
57 |
|
|
|
58 |
d88c6a9f
|
Scott Ullrich
|
$pgtitle = array("System","Firmware","Settings");
|
59 |
52380979
|
Scott Ullrich
|
include("head.inc");
|
60 |
|
|
|
61 |
0b2e3c64
|
Colin Smith
|
?>
|
62 |
52380979
|
Scott Ullrich
|
|
63 |
0b2e3c64
|
Colin Smith
|
<script language="JavaScript">
|
64 |
|
|
<!--
|
65 |
|
|
var systemdescs=new Array(4);
|
66 |
|
|
systemdescs[0]="This patch system uses a combination of unified and binary diffs. This system requires the least bandwidth, but is less forgiving of errors.";
|
67 |
|
|
systemdescs[1]="This patch system uses tar files to update the system. This requires the most bandwidth, but is more reliable.";
|
68 |
|
|
systemdescs[2]="This patch system uses tar files for the kernel and base system, and unified diffs for other components.";
|
69 |
|
|
|
70 |
|
|
var branchinfo=new Array(4);
|
71 |
|
|
branchinfo[0]="The stable branch contains only those updates believed to be stable by the developers.";
|
72 |
|
|
branchinfo[1]="This branch contains both stable updates as well as those believed to be fairly stable.";
|
73 |
|
|
branchinfo[2]="This branch contains all released updates, regardless of stability.";
|
74 |
|
|
|
75 |
|
|
function update_description(itemnum) {
|
76 |
|
|
document.forms[0].branchinfo.value=branchinfo[itemnum];
|
77 |
|
|
}
|
78 |
|
|
|
79 |
9471afe1
|
Colin Smith
|
function enable_altfirmwareurl(enable_over) {
|
80 |
|
|
if (document.iform.alturlenable.checked || enable_over) {
|
81 |
|
|
document.iform.firmwareurl.disabled = 0;
|
82 |
|
|
document.iform.firmwarepath.disabled = 0;
|
83 |
|
|
} else {
|
84 |
|
|
document.iform.firmwareurl.disabled = 1;
|
85 |
|
|
document.iform.firmwarepath.disabled = 1;
|
86 |
|
|
}
|
87 |
|
|
}
|
88 |
|
|
|
89 |
0b2e3c64
|
Colin Smith
|
// -->
|
90 |
|
|
</script>
|
91 |
|
|
|
92 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
93 |
b30cacb2
|
Bill Marquette
|
<?php include("fbegin.inc");?>
|
94 |
9471afe1
|
Colin Smith
|
<?php if ($input_errors) print_input_errors($input_errors); ?>
|
95 |
0b2e3c64
|
Colin Smith
|
<form action="system_firmware_settings.php" method="post" name="iform" id="iform">
|
96 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
97 |
c03d45a2
|
Colin Smith
|
<table width="100%" border="0" cellpadding="0" cellspacing="0">
|
98 |
0b2e3c64
|
Colin Smith
|
<tr>
|
99 |
|
|
<td>
|
100 |
4820d297
|
Scott Ullrich
|
<?php
|
101 |
|
|
$tab_array = array();
|
102 |
|
|
$tab_array[0] = array("Manual Update", false, "system_firmware.php");
|
103 |
|
|
$tab_array[1] = array("Auto Update", false, "system_firmware_check.php");
|
104 |
|
|
$tab_array[2] = array("Updater Settings", true, "system_firmware_settings.php");
|
105 |
|
|
display_top_tabs($tab_array);
|
106 |
|
|
?>
|
107 |
0b2e3c64
|
Colin Smith
|
</td>
|
108 |
|
|
</tr>
|
109 |
e12d98ea
|
Bill Marquette
|
<tr><td><div id=mainarea>
|
110 |
|
|
<table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
|
111 |
0b2e3c64
|
Colin Smith
|
<tr>
|
112 |
|
|
<td colspan="2" valign="top" class="listtopic">Firmware Branch</td>
|
113 |
|
|
</tr>
|
114 |
|
|
<tr>
|
115 |
9471afe1
|
Colin Smith
|
<td valign="top" class="vncell">Firmware Branch</td>
|
116 |
|
|
<td class="vtable">
|
117 |
0b2e3c64
|
Colin Smith
|
<select onChange="update_description(this.selectedIndex);" name="branch" id="branch">
|
118 |
|
|
<option value="stable"<?php if($curcfg['branch']=="stable") echo " SELECTED"; ?>>Stable</option>
|
119 |
|
|
<option value="beta"<?php if($curcfg['branch']=="beta") echo " SELECTED"; ?>>Beta</option>
|
120 |
247c58ad
|
Bill Marquette
|
<option value="alpha"<?php if($curcfg['branch']=="alpha") echo " SELECTED"; ?>>Alpha</option>
|
121 |
0b2e3c64
|
Colin Smith
|
</select>
|
122 |
e6c2bb14
|
Scott Ullrich
|
<br>
|
123 |
d4fddf14
|
Scott Ullrich
|
<textarea cols="60" rows="2" id="branchinfo" name="branchinfo"style="padding:5px; border:1px dashed #990000; background-color: #ffffff; color: #000000; font-size: 8pt;">
|
124 |
0b2e3c64
|
Colin Smith
|
</textarea>
|
125 |
|
|
<script language="javascript">
|
126 |
|
|
update_description(document.forms[0].branch.selectedIndex);
|
127 |
|
|
</script>
|
128 |
78d38525
|
Colin Smith
|
<br><span class="vexpl">Select the update branch you would like this system to track.</td>
|
129 |
9471afe1
|
Colin Smith
|
</tr>
|
130 |
|
|
<tr>
|
131 |
|
|
<td valign="top" class="vncell">Firmware XMLRPC URL</td>
|
132 |
|
|
<td class="vtable">
|
133 |
|
|
<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onClick="enable_altfirmwareurl()" <?php if(isset($curcfg['alturl']['enable'])) echo "checked"; ?>> Use a different XMLRPC server for firmware upgrades<br>
|
134 |
|
|
<table>
|
135 |
b5c78501
|
Seth Mos
|
<tr><td>Base URL:</td><td><input name="firmwareurl" type="input" class="formfld url" id="firmwareurl" size="64" value="<?php if($curcfg['alturl']['firmwareurl']) echo $curcfg['alturl']['firmwareurl']; else echo $g['xmlrpcbaseurl']; ?>"></td></tr>
|
136 |
|
|
<tr><td>Path:</td><td><input name="firmwarepath" type="input" class="formfld unknown"id="firmwarepath" size="64" value="<?php if($curcfg['alturl']['firmwarepath']) echo $curcfg['alturl']['firmwarepath']; else echo $g['xmlrpcpath']; ?>"></td></tr>
|
137 |
9471afe1
|
Colin Smith
|
</table>
|
138 |
|
|
<span class="vexpl">This is where pfSense will check for newer firmware versions when the <a href="system_firmware_check.php">System: Firmware: Auto Update</a> page is viewed.</span></td>
|
139 |
|
|
</tr>
|
140 |
|
|
<script>enable_altfirmwareurl();</script>
|
141 |
0b2e3c64
|
Colin Smith
|
<!--
|
142 |
|
|
<tr>
|
143 |
|
|
<td width="22%" valign="top" class="vncell">Update Preference</td>
|
144 |
|
|
<td width="78%" class="vtable">
|
145 |
|
|
<select onChange="update_description(branchinfo, this.selectedIndex);" name="branch" id="branch">
|
146 |
|
|
<option value="patches"<?php if($curcfg['updates']=="diffs") echo " SELECTED"; ?>>Patches</option>
|
147 |
|
|
<option value="full"<?php if($curcfg['updates']=="full") echo " SELECTED"; ?>>Full Updates</option>
|
148 |
|
|
<option value="combination"<?php if($config['updates']=="combination") echo " SELECTED"; ?>>Combination</option>
|
149 |
|
|
</select>
|
150 |
|
|
<textarea cols="60" rows="2" id="info" name="info"style="border:1px dashed #000066; background-color: #ffffff; color: #000000; font-size: 8pt;">
|
151 |
|
|
</textarea>
|
152 |
|
|
<script language="javascript">
|
153 |
|
|
update_description(branchinfo, document.forms[0].optimization.selectedIndex);
|
154 |
|
|
</script>
|
155 |
|
|
<br><span class="vexpl"><b>Select the update branch you would like this system to track</b></td>
|
156 |
|
|
</tr>
|
157 |
|
|
-->
|
158 |
|
|
<tr>
|
159 |
|
|
<td width="22%" valign="top"> </td>
|
160 |
|
|
<td width="78%">
|
161 |
2346d159
|
Colin Smith
|
<input name="Submit" type="submit" class="formbtn" value="Save">
|
162 |
0b2e3c64
|
Colin Smith
|
</td>
|
163 |
|
|
</tr>
|
164 |
e12d98ea
|
Bill Marquette
|
</table></div></td></tr></table>
|
165 |
0b2e3c64
|
Colin Smith
|
</form>
|
166 |
|
|
<?php include("fend.inc"); ?>
|
167 |
|
|
</body>
|
168 |
|
|
</html>
|