summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2006-03-31 02:47:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2006-03-31 02:47:11 +0000
commit47c44d0ad842034decd87cb4e40b4a7539b00fdd (patch)
tree2cde8f92e8701e5ae646e6b7c214b378a0ce39a1 /usr
parentd65b55aca088dd3752911d03163dfe555ea23b31 (diff)
downloadpfsense-47c44d0ad842034decd87cb4e40b4a7539b00fdd.zip
pfsense-47c44d0ad842034decd87cb4e40b4a7539b00fdd.tar.gz
If a lookup fails to pfsense.com and the cache file does not exist, give a correct error.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/pkg_mgr.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php
index ab84115..a83f587 100755
--- a/usr/local/www/pkg_mgr.php
+++ b/usr/local/www/pkg_mgr.php
@@ -35,11 +35,15 @@ if($pkg_info) {
$fout = fopen("{$g['tmp_path']}/pkg_info.cache", "w");
fwrite($fout, serialize($pkg_info));
fclose($fout);
- //$pkg_sizes = get_pkg_sizes();
+ //$pkg_sizes = get_pkg_sizes();
} else {
$using_cache = true;
- $savemsg = "Unable to retrieve package info from {$g['xmlrpcbaseurl']}. Cached data will be used.";
- $pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache"));
+ if(file_exists("{$g['tmp_path']}/pkg_info.cache")) {
+ $savemsg = "Unable to retrieve package info from {$g['xmlrpcbaseurl']}. Cached data will be used.";
+ $pkg_info = unserialize(@file_get_contents("{$g['tmp_path']}/pkg_info.cache"));
+ } else {
+ $savemsg = "Unable to communicate to pfSense.com. Please check DNS, default gateway, etc.";
+ }
}
$pgtitle = "System: Package Manager";
OpenPOWER on IntegriCloud