From 39e10a30679d38db3351e60fc77513f52efdee83 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Sat, 7 May 2005 00:56:25 +0000 Subject: Cache received version data. --- usr/local/www/system_firmware_check.php | 274 +++++++++++--------------------- 1 file changed, 93 insertions(+), 181 deletions(-) (limited to 'usr/local/www/system_firmware_check.php') diff --git a/usr/local/www/system_firmware_check.php b/usr/local/www/system_firmware_check.php index f97978f..418f96b 100755 --- a/usr/local/www/system_firmware_check.php +++ b/usr/local/www/system_firmware_check.php @@ -2,204 +2,116 @@ . - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, - INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, - OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - POSSIBILITY OF SUCH DAMAGE. + system_firmware.php + Copyright (C) 2004, 2005 Scott Ullrich and Colin Smith + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. */ -$d_isfwfile = 1; require("guiconfig.inc"); -require("xmlrpc_client.inc"); - -function old_checkversion() { - global $g; - $versioncheck_base_url = 'www.pfSense.com'; - $versioncheck_path = '/pfSense/checkversion.php'; - $post = "platform=" . rawurlencode(trim(file_get_contents("/etc/platform"))) . - "&version=" . rawurlencode(trim(file_get_contents("/etc/version"))); - $rfd = @fsockopen($versioncheck_base_url, 80, $errno, $errstr, 3); - if ($rfd) { - $hdr = "POST {$versioncheck_path} HTTP/1.0\r\n"; - $hdr .= "Content-Type: application/x-www-form-urlencoded\r\n"; - $hdr .= "User-Agent: pfSense-webConfigurator/1.0\r\n"; - $hdr .= "Host: www.pfSense.com\r\n"; - $hdr .= "Content-Length: " . strlen($post) . "\r\n\r\n"; - - fwrite($rfd, $hdr); - fwrite($rfd, $post); - - $inhdr = true; - $resp = ""; - while (!feof($rfd)) { - $line = fgets($rfd); - if ($inhdr) { - if (trim($line) == "") - $inhdr = false; - } else { - $resp .= $line; - } - } - - fclose($rfd); - - if($_GET['autoupgrade'] <> "") - return; - - return $resp; - } - - return null; -} +require("xmlparse_pkg.inc"); +require("xmlrpc.inc"); ?> -<?=gentitle("System: Firmware: Invoke Auto Upgrade");?> +<?=gentitle("System: Firmware Update");?> - - - -

System: Firmware: Auto Upgrade

- -
- + +

System: Firmware Update

+
+
- - - -
+ +
- + + + + + + + + + $version) { + if($key == "current") continue; + if($version == 1) { + $img = "pass.gif"; + } else { + $allinstall = true; + $currentver = array_pop($version); + $img = "block.gif"; + } + ?> + + + + + + + + + + + +
ActCategoryInstalledCurrent +
+ +
+ +


+ +
+ +
- - - - -
- -
-
-
- - -
-

-

-
-
- -

- document.progressbar.style.visibility='hidden';\n"; - + include("fend.inc"); + $versions['cachetime'] == time(); + $fout = fopen("/tmp/versioncheck.cache", "w"); + fwrite($fout, serialize($versions)); + fclose($fout); ?> - - - - - - - \ No newline at end of file -- cgit v1.1