1 |
ee11cc6e
|
Scott Ullrich
|
#!/usr/local/bin/php
|
2 |
|
|
<?php
|
3 |
|
|
/*
|
4 |
|
|
pkg_mgr.php
|
5 |
|
|
Copyright (C) 2004 Scott Ullrich
|
6 |
|
|
All rights reserved.
|
7 |
|
|
|
8 |
|
|
Redistribution and use in source and binary forms, with or without
|
9 |
|
|
modification, are permitted provided that the following conditions are met:
|
10 |
|
|
|
11 |
|
|
1. Redistributions of source code must retain the above copyright notice,
|
12 |
|
|
this list of conditions and the following disclaimer.
|
13 |
|
|
|
14 |
|
|
2. Redistributions in binary form must reproduce the above copyright
|
15 |
|
|
notice, this list of conditions and the following disclaimer in the
|
16 |
|
|
documentation and/or other materials provided with the distribution.
|
17 |
|
|
|
18 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
19 |
|
|
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
20 |
|
|
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
21 |
|
|
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
|
22 |
|
|
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
23 |
|
|
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
24 |
|
|
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
25 |
|
|
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
26 |
|
|
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
27 |
|
|
POSSIBILITY OF SUCH DAMAGE.
|
28 |
|
|
*/
|
29 |
|
|
|
30 |
|
|
require("guiconfig.inc");
|
31 |
|
|
require("xmlparse_pkg.inc");
|
32 |
|
|
|
33 |
|
|
?>
|
34 |
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
35 |
|
|
<html>
|
36 |
|
|
<head>
|
37 |
|
|
<title><?=gentitle("System: Package Manager");?></title>
|
38 |
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
39 |
|
|
<link href="gui.css" rel="stylesheet" type="text/css">
|
40 |
|
|
</head>
|
41 |
|
|
|
42 |
|
|
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
|
43 |
859329c8
|
Scott Ullrich
|
<?php
|
44 |
|
|
include("fbegin.inc");
|
45 |
|
|
?>
|
46 |
ee11cc6e
|
Scott Ullrich
|
<p class="pgtitle">System: Package Manager</p>
|
47 |
|
|
<form action="firewall_nat_out_load_balancing.php" method="post">
|
48 |
|
|
<?php if ($savemsg) print_info_box($savemsg); ?>
|
49 |
|
|
<table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr><td>
|
50 |
|
|
<ul id="tabnav">
|
51 |
|
|
<li class="tabinact"><a href="pkg_mgr.php">Available Packages</a></li>
|
52 |
|
|
<li class="tabact">Installed Packages</li>
|
53 |
|
|
</ul>
|
54 |
|
|
</td></tr>
|
55 |
|
|
<tr>
|
56 |
|
|
<td class="tabcont">
|
57 |
|
|
<table width="100%" border="0" cellpadding="6" cellspacing="0">
|
58 |
|
|
<tr>
|
59 |
|
|
<td width="25%" class="listhdrr">Package Name</td>
|
60 |
3a003406
|
Scott Ullrich
|
<td width="20%" class="listhdrr">Category</td>
|
61 |
|
|
<td width="10%" class="listhdrr">Version</td>
|
62 |
|
|
<td width="45%" class="listhdr">Description</td>
|
63 |
ee11cc6e
|
Scott Ullrich
|
</tr>
|
64 |
|
|
|
65 |
|
|
<?php
|
66 |
|
|
$i = 0;
|
67 |
|
|
if($config['installedpackages']['package']) {
|
68 |
|
|
foreach ($config['installedpackages']['package'] as $pkg) {
|
69 |
|
|
if($pkg['name'] <> "") {
|
70 |
|
|
?>
|
71 |
|
|
<tr valign="top">
|
72 |
|
|
<td class="listlr">
|
73 |
|
|
<?= $pkg['name'] ?>
|
74 |
|
|
</td>
|
75 |
|
|
<td class="listlr">
|
76 |
|
|
<?= $pkg['category'] ?>
|
77 |
|
|
</td>
|
78 |
3a003406
|
Scott Ullrich
|
<td class="listlr">
|
79 |
|
|
<?php
|
80 |
|
|
$latest_version = get_latest_package_version($pkg['name']);
|
81 |
c87c2fb0
|
Scott Ullrich
|
if($pkg['version'] <> $latest_version) {
|
82 |
3a003406
|
Scott Ullrich
|
/* a new version of the package is available */
|
83 |
|
|
$id = get_pkg_id($pkg['name']);
|
84 |
|
|
echo "Upgrade: <a href='pkg_mgr_delete.php?upgrade=true&id={$id}'>" . $latest_version . "</a>";
|
85 |
|
|
echo "<br>Installed: " . $pkg['version'];
|
86 |
|
|
} else {
|
87 |
|
|
echo $pkg['version'];
|
88 |
|
|
}
|
89 |
|
|
?>
|
90 |
|
|
</td>
|
91 |
ee11cc6e
|
Scott Ullrich
|
<td class="listbg">
|
92 |
|
|
<font color="#FFFFFFF">
|
93 |
|
|
<?= $pkg['descr'] ?>
|
94 |
|
|
</td>
|
95 |
|
|
<td valign="middle" class="list" nowrap>
|
96 |
401d96e1
|
Scott Ullrich
|
<a onclick="return confirm('Do you really want to remove this package?')" href="pkg_mgr_delete.php?pkg=<?= $pkg['name']; ?>"><img src="x.gif" width="17" height="17" border="0"></a>
|
97 |
ee11cc6e
|
Scott Ullrich
|
</td>
|
98 |
|
|
</tr>
|
99 |
|
|
<?php
|
100 |
|
|
$i++;
|
101 |
|
|
}
|
102 |
|
|
}
|
103 |
|
|
}
|
104 |
54587e4e
|
Scott Ullrich
|
if($i == 0) echo "<tr><td colspan=\"3\"><center>There are currently no packages installed.</td></tr>";
|
105 |
ee11cc6e
|
Scott Ullrich
|
?>
|
106 |
|
|
</table>
|
107 |
|
|
</td>
|
108 |
|
|
</tr>
|
109 |
|
|
</table>
|
110 |
|
|
</form>
|
111 |
|
|
<?php include("fend.inc"); ?>
|
112 |
|
|
</body>
|
113 |
|
|
</html>
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|