summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php5
-rw-r--r--web/lib/pkgreqfuncs.inc.php9
2 files changed, 7 insertions, 7 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 3f02bc77..3e4b5724 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -513,10 +513,7 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via, $grant=false) {
if (!$action) {
$username = username_from_sid($_COOKIE['AURSID']);
foreach ($base_ids as $base_id) {
- $pkgreq_ids = array_merge(
- pkgreq_by_pkgbase($base_id, 'deletion'),
- pkgreq_by_pkgbase($base_id, 'merge'),
- pkgreq_by_pkgbase($base_id, 'orphan'));
+ $pkgreq_ids = array_merge(pkgreq_by_pkgbase($base_id));
foreach ($pkgreq_ids as $pkgreq_id) {
pkgreq_close(intval($pkgreq_id), 'accepted',
'The user ' . $username .
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index e4c63b57..c056d681 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -49,15 +49,18 @@ function pkgreq_list($offset, $limit) {
*
* @return array List of package request IDs
*/
-function pkgreq_by_pkgbase($baseid, $type) {
+function pkgreq_by_pkgbase($baseid, $type=false) {
$dbh = DB::connect();
$q = "SELECT PackageRequests.ID ";
$q.= "FROM PackageRequests INNER JOIN RequestTypes ON ";
$q.= "RequestTypes.ID = PackageRequests.ReqTypeID ";
$q.= "WHERE PackageRequests.Status = 0 ";
- $q.= "AND PackageRequests.PackageBaseID = " . intval($baseid) . " ";
- $q.= "AND RequestTypes.Name = " . $dbh->quote($type);
+ $q.= "AND PackageRequests.PackageBaseID = " . intval($baseid);
+
+ if ($type) {
+ $q .= " AND RequestTypes.Name = " . $dbh->quote($type);
+ }
return $dbh->query($q)->fetchAll(PDO::FETCH_COLUMN, 0);
}