summaryrefslogtreecommitdiffstats
path: root/usr/local/www/widgets/widgets/system_information.widget.php
diff options
context:
space:
mode:
authorjim-p <jim@pingle.org>2010-04-16 12:24:27 -0400
committerjim-p <jim@pingle.org>2010-04-16 12:24:27 -0400
commit2cfbe062cb598cdcf4d26e78f84aaee4b8bb1da0 (patch)
treedc657039037a355a838e39c10ad2d946b5f06ab3 /usr/local/www/widgets/widgets/system_information.widget.php
parenta76c1c453a207195d70de9da4a3ac3b4b0840162 (diff)
downloadpfsense-2cfbe062cb598cdcf4d26e78f84aaee4b8bb1da0.zip
pfsense-2cfbe062cb598cdcf4d26e78f84aaee4b8bb1da0.tar.gz
Update system information widget to use new version checking mechanism.
Diffstat (limited to 'usr/local/www/widgets/widgets/system_information.widget.php')
-rw-r--r--usr/local/www/widgets/widgets/system_information.widget.php17
1 files changed, 9 insertions, 8 deletions
diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php
index 294867d..9e58f1b 100644
--- a/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/usr/local/www/widgets/widgets/system_information.widget.php
@@ -35,31 +35,32 @@ require_once("functions.inc");
require_once("guiconfig.inc");
require_once('notices.inc');
+
if($_REQUEST['getupdatestatus']) {
if(isset($curcfg['alturl']['enable']))
$updater_url = "{$config['system']['firmware']['alturl']['firmwareurl']}";
else
$updater_url = $g['update_url'];
download_file_with_progress_bar("{$updater_url}/version", "/tmp/{$g['product_name']}_version");
- $latest_version = file_get_contents("/tmp/{$g['product_name']}_version");
- if(empty($latest_version))
+ $remote_version = trim(@file_get_contents("/tmp/{$g['product_name']}_version"));
+ if(empty($remote_version))
echo "<br /><br />Unable to check for updates.";
else {
- $current_installed_pfsense_version = strtotime(str_replace("\n", "", file_get_contents("/etc/version.buildtime")));
+ $current_installed_buildtime = trim(file_get_contents("/etc/version.buildtime"));
+ $current_installed_version = trim(file_get_contents("/etc/version"));
- $latest_version = strtotime(str_replace("\n", "", file_get_contents("/tmp/{$g['product_name']}_version")));
- if(!$latest_version) {
- echo "<br /><br />Unable to check for updates.";
+ if(!$remote_version) {
+ echo "<br /><br />Unable to check for updates.";
}
else {
$needs_system_upgrade = false;
- if($current_installed_pfsense_version < $latest_version) {
+ if (pfs_version_compare($current_installed_buildtime, $current_installed_version, $remote_version) == -1) {
echo "<br/><span class=\"red\" id=\"updatealert\"><b>Update available. </b></span><a href=\"/system_firmware_check.php\">Click Here</a> to view update.";
echo "<script type=\"text/javascript\">";
echo "Effect.Pulsate('updatealert', { pulses: 30, duration: 10});";
echo "</script>";
} else
- echo "<br /><br />You are on the latest version.";
+ echo "<br />You are on the latest version.";
}
}
exit;
OpenPOWER on IntegriCloud