From 00b1a7ebc15f7ebd597cf6d6a2e6cbcfeccf6c28 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Sat, 24 May 2008 06:38:59 +0000 Subject: Add back auto update support. Discussed-with: cmb --- usr/local/www/system_firmware_check.php | 335 +++++++++++++------------------- 1 file changed, 130 insertions(+), 205 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 3563e07..903cd79 100755 --- a/usr/local/www/system_firmware_check.php +++ b/usr/local/www/system_firmware_check.php @@ -1,233 +1,158 @@ . + 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. -Header("Location: system_firmware.php"); -exit; + 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. -require_once("guiconfig.inc"); -require_once("xmlrpc.inc"); + 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"); -if(isset($config['system']['disablefirmwarecheck'])) - Header("Location: system_firmware.php"); +$curcfg = $config['system']['firmware']; -$versions = check_firmware_version(); -$pgtitle = "System: Firmware: Auto Update"; include("head.inc"); ?> + + + + + + + + -

- - - -
+

System: Firmware: Auto Upgrade

+ +
+ + + - - -
-
- -
- - - - - - - $version) { - if($key == "current") continue; - $currentver = array_shift(explode('-', $currentvers[$key]['version'])); - if($version == 1) { - $img = "./themes/".$g['theme']."/images/icons/icon_pass.gif"; - $pastlatest = true; - } elseif( strcmp($currentver , $version[count($version) - 1]['version']) ){ - $img = "./themes/".$g['theme']."/images/icons/icon_pass.gif"; - $pastlatest = true; - } else { - $allinstall = true; - $img = "./themes/".$g['theme']."/images/icons/icon_block.gif"; - } -?> - - - - - - - - - - - - - - - -
ActCategoryInstalledCurrent -
- -
- -
-
- - - - - - - -
Needed Updates
-
-
- - - - - - - - - $value) { - if(($key == "current") or ($value == 1)) continue; - if(is_array($value)) { - foreach($value as $version) { - if(!$version['time']) $version['time'] = "Unknown"; - if(!$version['size']) $version['size'] = "Unknown"; - if(!$version['type']) $version['type'] = "Unknown"; - $version['category'] = $key; - $times[$version['time']][] = $version; - } - } - } - } - asort($times); - if(is_array($times)) { - foreach($times as $time) { - foreach($time as $version) { -?> - - - - - - - - + + + + + +
ReleasedCategoryVersionSizeType
- -
+ + + + +
+ +
+ + + + + - -
+ + +
+ +
-
-
-
- - -
- - - +
- +
+ + +
+

+

+
+
+ +

+ $latest_version) + $needs_system_upgrade = true; + +if(!$latest_version) { + if(isset($curcfg['alturl']['enable'])) + update_output_window("Could not contact custom update server."); + else + update_output_window("Could not contact {$g['product_name']} update server {$updater_url}."); } else { - print_info_box("Unable to receive version information."); + if($needs_system_upgrade) { + echo "\n"; + update_output_window("A new version is now available. \n\nNew version: {$latest_version}"); + } else { + update_output_window("You are on the latest version."); + } } ?> -

- - + + + + + + + + \ No newline at end of file -- cgit v1.1