From 746ec8978b2f7d3fb77b82e43ae53a7177224826 Mon Sep 17 00:00:00 2001 From: Colin Smith Date: Tue, 7 Jun 2005 19:09:25 +0000 Subject: Don't throw errors if no packages are currently installed. --- usr/local/www/pkg_mgr_installed.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'usr/local/www/pkg_mgr_installed.php') diff --git a/usr/local/www/pkg_mgr_installed.php b/usr/local/www/pkg_mgr_installed.php index b2551d2..107d3f8 100755 --- a/usr/local/www/pkg_mgr_installed.php +++ b/usr/local/www/pkg_mgr_installed.php @@ -31,11 +31,12 @@ require_once("guiconfig.inc"); require_once("pkg-utils.inc"); -foreach($config['installedpackages']['package'] as $instpkg) { - $tocheck[] = $instpkg['name']; +if(is_array($config['installedpackages']['package'])) { + foreach($config['installedpackages']['package'] as $instpkg) { + $tocheck[] = $instpkg['name']; + } + $currentvers = get_pkg_info($tocheck, array('version', 'xmlver')); } -$currentvers = get_pkg_info($tocheck, array('version', 'xmlver')); - ?> @@ -67,17 +68,12 @@ include("fbegin.inc"); XML Version Description - $pkgname){ - if(!is_string($pkgname)) { - echo "
There are currently no packages installed."; - break; - } $pkg = $config['installedpackages']['package'][$index]; if($pkg['name'] <> "") { ?> @@ -153,7 +149,7 @@ include("fbegin.inc"); } } } else { - echo "
There are currently no packages installed."; + echo "
There are no packages currently installed."; } ?> -- cgit v1.1