From 47c44d0ad842034decd87cb4e40b4a7539b00fdd Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 31 Mar 2006 02:47:11 +0000 Subject: If a lookup fails to pfsense.com and the cache file does not exist, give a correct error. --- usr/local/www/pkg_mgr.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'usr') 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"; -- cgit v1.1