Project

General

Profile

Download (5.45 KB) Statistics
| Branch: | Tag: | Revision:
1 0b2e3c64 Colin Smith
<?php
2
/* $Id$ */
3
/*
4 2094568a Colin Smith
	system_firmware_settings.php
5 0b2e3c64 Colin Smith
        part of pfSense
6 82cf212a Scott Ullrich
		Copyright (C) 2008 Scott Ullrich
7 2094568a Colin Smith
        Copyright (C) 2005 Colin Smith
8 0b2e3c64 Colin Smith
9
	Redistribution and use in source and binary forms, with or without
10
	modification, are permitted provided that the following conditions are met:
11
12
	1. Redistributions of source code must retain the above copyright notice,
13
	   this list of conditions and the following disclaimer.
14
15
	2. Redistributions in binary form must reproduce the above copyright
16
	   notice, this list of conditions and the following disclaimer in the
17
	   documentation and/or other materials provided with the distribution.
18
19
	THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
20
	INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
21
	AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22
	AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
23
	OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24
	SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25
	INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26
	CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27
	ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28
	POSSIBILITY OF SUCH DAMAGE.
29
*/
30
31
require("guiconfig.inc");
32
33
if ($_POST) {
34 9471afe1 Colin Smith
	if (!$input_errors) {
35
		if($_POST['alturlenable'] == "yes") {
36 00b1a7eb Scott Ullrich
			$config['system']['firmware']['alturl']['enable'] = true;
37 9471afe1 Colin Smith
			$config['system']['firmware']['alturl']['firmwareurl'] = $_POST['firmwareurl'];
38
		} else {
39
			unset($config['system']['firmware']['alturl']['enable']);
40 00b1a7eb Scott Ullrich
			unset($config['system']['firmware']['alturl']['firmwareurl']);
41
			unset($config['system']['firmware']['alturl']);
42
			unset($config['system']['firmware']);			
43 9471afe1 Colin Smith
		}
44
		write_config();
45
	}
46 0b2e3c64 Colin Smith
}
47
48
$curcfg = $config['system']['firmware'];
49
50 ebd65ea5 Scott Ullrich
$pgtitle = "System: Firmware: Settings";
51 52380979 Scott Ullrich
include("head.inc");
52
53 00b1a7eb Scott Ullrich
exec("fetch -q -o /tmp/manifest \"{$g['update_manifest']}\"");
54
if(file_exists("/tmp/manifest")) {
55
	$preset_urls_split = split("\n", file_get_contents("/tmp/manifest"));
56
}
57 52380979 Scott Ullrich
58 00b1a7eb Scott Ullrich
?>
59
<script src="/javascript/scriptaculous/prototype.js" type="text/javascript"></script>
60 6a0f55d8 Scott Ullrich
<script src="/javascript/scriptaculous/scriptaculous.js" type="text/javascript"></script>
61 0b2e3c64 Colin Smith
<script language="JavaScript">
62
<!--
63
64
65 9471afe1 Colin Smith
function enable_altfirmwareurl(enable_over) {  	 
66
	if (document.iform.alturlenable.checked || enable_over) { 	 
67
		document.iform.firmwareurl.disabled = 0; 	 
68
	} else { 	 
69 36756d85 Scott Ullrich
		document.iform.firmwareurl.disabled = 1;
70
		document.iform.firmwareurl.value = '';
71 9471afe1 Colin Smith
	} 	 
72
}
73
74 0b2e3c64 Colin Smith
// -->
75
</script>
76
77
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
78 b30cacb2 Bill Marquette
<?php include("fbegin.inc");?>
79 6d2c42d1 Scott Ullrich
<p class="pgtitle">System: Firmware: Settings</p>
80 9471afe1 Colin Smith
<?php if ($input_errors) print_input_errors($input_errors); ?>
81 0b2e3c64 Colin Smith
<form action="system_firmware_settings.php" method="post" name="iform" id="iform">
82
            <?php if ($savemsg) print_info_box($savemsg); ?>
83 c03d45a2 Colin Smith
              <table width="100%" border="0" cellpadding="0" cellspacing="0">
84 0b2e3c64 Colin Smith
	<tr>
85
		<td>
86 4820d297 Scott Ullrich
<?php
87
	$tab_array = array();
88
	$tab_array[0] = array("Manual Update", false, "system_firmware.php");
89
	$tab_array[1] = array("Auto Update", false, "system_firmware_check.php");
90
	$tab_array[2] = array("Updater Settings", true, "system_firmware_settings.php");
91
	display_top_tabs($tab_array);
92
?>
93 0b2e3c64 Colin Smith
		</td>
94
	</tr>
95 e12d98ea Bill Marquette
	<tr><td><div id=mainarea>
96
	      <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0">
97 0b2e3c64 Colin Smith
	<tr>
98
		<td colspan="2" valign="top" class="listtopic">Firmware Branch</td>
99
	</tr>
100 00b1a7eb Scott Ullrich
<?php if(is_array($preset_urls_split)): ?>
101 0b2e3c64 Colin Smith
	<tr>
102 00b1a7eb Scott Ullrich
		<td valign="top" class="vncell">Default Auto Update URLs</td>
103
		<td class="vtable">
104 6a0f55d8 Scott Ullrich
			<select name='preseturls' id='preseturls' onChange="firmwareurl.value = preseturls.value; document.iform.firmwareurl.disabled = 0; alturlenable.checked=true; new Effect.Highlight(this.parentNode, { startcolor: '#ffff99', endcolor: '#fffffff' });">
105 00b1a7eb Scott Ullrich
					<option></option>
106
				<?php 
107
					foreach($preset_urls_split as $pus) {
108
						$pus_text = split("\t", $pus);
109
						if($pus_text[0])
110
							echo "<option value='{$pus_text[1]}'>{$pus_text[0]}</option>";
111
					}
112
				?>
113 0b2e3c64 Colin Smith
			</select>
114 00b1a7eb Scott Ullrich
		</td>
115 9471afe1 Colin Smith
	</tr>
116 00b1a7eb Scott Ullrich
<?php endif; ?>
117 9471afe1 Colin Smith
	<tr>
118 00b1a7eb Scott Ullrich
		<td valign="top" class="vncell">Firmware Auto Update URL</td>
119 9471afe1 Colin Smith
		<td class="vtable">
120 c46b213f Scott Ullrich
			<input name="alturlenable" type="checkbox" id="alturlenable" value="yes" onClick="enable_altfirmwareurl()" <?php if(isset($curcfg['alturl']['enable'])) echo "checked"; ?>> Use a different URL server for firmware upgrades other than <?php echo $g['"product_website"']; ?><br>
121 9471afe1 Colin Smith
			<table>
122 80e55bad Scott Ullrich
			<tr><td>Base URL:</td><td><input name="firmwareurl" type="input" id="firmwareurl" size="64" value="<?php if($curcfg['alturl']['firmwareurl']) echo $curcfg['alturl']['firmwareurl']; else echo $g['']; ?>"></td></tr>
123 9471afe1 Colin Smith
			</table>
124 00b1a7eb Scott Ullrich
			<span class="vexpl">
125 d45ea3d3 Scott Ullrich
				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.
126 00b1a7eb Scott Ullrich
				<p/>
127
				<b>NOTE:</b> When a custom URL is enabled the system will not verify the digital signature from <?php echo $g['product_website'] ?>.
128
				</span>
129
				</td>
130 9471afe1 Colin Smith
	</tr>
131
	<script>enable_altfirmwareurl();</script>
132 0b2e3c64 Colin Smith
                <tr>
133
                  <td width="22%" valign="top">&nbsp;</td>
134
                  <td width="78%">
135 2346d159 Colin Smith
                    <input name="Submit" type="submit" class="formbtn" value="Save">
136 0b2e3c64 Colin Smith
                  </td>
137
                </tr>
138 e12d98ea Bill Marquette
              </table></div></td></tr></table>
139 0b2e3c64 Colin Smith
</form>
140
<?php include("fend.inc"); ?>
141
</body>
142
</html>