diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2006-03-31 02:47:11 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2006-03-31 02:47:11 +0000 |
commit | 47c44d0ad842034decd87cb4e40b4a7539b00fdd (patch) | |
tree | 2cde8f92e8701e5ae646e6b7c214b378a0ce39a1 /usr | |
parent | d65b55aca088dd3752911d03163dfe555ea23b31 (diff) | |
download | pfsense-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-x | usr/local/www/pkg_mgr.php | 10 |
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"; |