summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2017-08-11 10:27:25 -0300
committerRenato Botelho <renato@netgate.com>2017-08-11 10:27:25 -0300
commitcbaf07f41d381afaaf076d77680e4c70c1463d78 (patch)
tree5a6d53412a6eeaf8477050c52b4b4ec30f3f782d /src
parent429091c8c0e2cd912de95eb52e8624b73d0adcbc (diff)
downloadpfsense-cbaf07f41d381afaaf076d77680e4c70c1463d78.zip
pfsense-cbaf07f41d381afaaf076d77680e4c70c1463d78.tar.gz
Show user when pkg metadata was updated
Diffstat (limited to 'src')
-rw-r--r--src/usr/local/www/widgets/widgets/system_information.widget.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/usr/local/www/widgets/widgets/system_information.widget.php b/src/usr/local/www/widgets/widgets/system_information.widget.php
index a737496..27d5ccb 100644
--- a/src/usr/local/www/widgets/widgets/system_information.widget.php
+++ b/src/usr/local/www/widgets/widgets/system_information.widget.php
@@ -54,11 +54,15 @@ $sysinfo_items = array(
if ($_REQUEST['getupdatestatus']) {
require_once("pkg-utils.inc");
+ $cache_file = $g['version_cache_file'];
+
if (isset($config['system']['firmware']['disablecheck'])) {
exit;
}
- $system_version = get_system_pkg_version();
+ /* If $_REQUEST['getupdatestatus'] == 2, force update */
+ $system_version = get_system_pkg_version(false,
+ ($_REQUEST['getupdatestatus'] == 1));
if ($system_version === false) {
print(gettext("<i>Unable to check for updates</i>"));
@@ -86,16 +90,28 @@ if ($_REQUEST['getupdatestatus']) {
<?php
break;
case '=':
- printf('<span class="text-success">%s</span>', gettext("The system is on the latest version."));
+ printf('<span class="text-success">%s</span>' . "\n",
+ gettext("The system is on the latest version."));
break;
case '>':
- print(gettext("The system is on a later version than<br />the official release."));
+ printf("%s\n", gettext(
+ "The system is on a later version than official release."));
break;
default:
- print(gettext( "<i>Error comparing installed version<br />with latest available</i>"));
+ printf("<i>%s</i>\n", gettext(
+ "Error comparing installed with latest version available"));
break;
}
+ if (file_exists($cache_file)):
+?>
+ <div>
+ <?printf("%s %s", gettext("Version information updated at"),
+ date("Y-m-d H:i", filemtime($cache_file)));?>
+ </div>
+<?php
+ endif;
+
exit;
} elseif ($_POST['widgetkey']) {
set_customwidgettitle($user_settings);
OpenPOWER on IntegriCloud