summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_mgr_installed.php
diff options
context:
space:
mode:
authorColin Smith <colin@pfsense.org>2005-06-07 19:09:25 +0000
committerColin Smith <colin@pfsense.org>2005-06-07 19:09:25 +0000
commit746ec8978b2f7d3fb77b82e43ae53a7177224826 (patch)
treeaf7af806033d63a4070f1c965268cbe78e35dc12 /usr/local/www/pkg_mgr_installed.php
parent497fa5ed303db73a116a907ee7aee9c8c4aae606 (diff)
downloadpfsense-746ec8978b2f7d3fb77b82e43ae53a7177224826.zip
pfsense-746ec8978b2f7d3fb77b82e43ae53a7177224826.tar.gz
Don't throw errors if no packages are currently installed.
Diffstat (limited to 'usr/local/www/pkg_mgr_installed.php')
-rwxr-xr-xusr/local/www/pkg_mgr_installed.php16
1 files changed, 6 insertions, 10 deletions
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'));
-
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
@@ -67,17 +68,12 @@ include("fbegin.inc");
<td width="10%" class="listhdrr">XML Version</td>
<td width="45%" class="listhdr">Description</td>
</tr>
-
<?php
if($config['installedpackages']['package'] != "") {
$instpkgs = array();
foreach($config['installedpackages']['package'] as $instpkg) $instpkgs[] = $instpkg['name'];
asort($instpkgs);
foreach ($instpkgs as $index => $pkgname){
- if(!is_string($pkgname)) {
- echo "<tr><td colspan=\"3\"><center>There are currently no packages installed.</td></tr>";
- break;
- }
$pkg = $config['installedpackages']['package'][$index];
if($pkg['name'] <> "") {
?>
@@ -153,7 +149,7 @@ include("fbegin.inc");
}
}
} else {
- echo "<tr><td colspan=\"3\"><center>There are currently no packages installed.</td></tr>";
+ echo "<tr><td colspan=\"3\"><center>There are no packages currently installed.</td></tr>";
}
?>
</table>
OpenPOWER on IntegriCloud