summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgreqfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-07-29 17:59:26 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-07-29 17:59:26 +0200
commitc70b340c41899926f121a37546f456a2e4608ffc (patch)
tree45891a9c0374030a2f00e6f1f6e85b44d0fe996b /web/lib/pkgreqfuncs.inc.php
parent98235c834b08c4528585fb46e0206699ccdbdecb (diff)
downloadaurweb-c70b340c41899926f121a37546f456a2e4608ffc.tar.xz
Close requests before accepting
When auto-accepting a request, we need to close the package request before performing the actual action (disown/deletion/merge). Otherwise, the former maintainer is not included in the Cc list of the acceptance/rejection notification email. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgreqfuncs.inc.php')
-rw-r--r--web/lib/pkgreqfuncs.inc.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index 2ae64e0..5924959 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -189,13 +189,19 @@ function pkgreq_file($ids, $type, $merge_into, $comments) {
if ($type == 'orphan' && $details['OutOfDateTS'] > 0 &&
time() - $details['OutOfDateTS'] >= $AUTO_ORPHAN_AGE &&
$AUTO_ORPHAN_AGE > 0) {
+ /*
+ * Close package request. NOTE: This needs to happen *before*
+ * the actual disown operation. Otherwise, the former
+ * maintainer will not be included in the Cc list of the
+ * request notification email.
+ */
+ pkgreq_close($request_id, "accepted",
+ "The package base has been flagged out-of-date " .
+ "since " . $out_of_date_time . ".", true);
$q = "UPDATE PackageBases SET MaintainerUID = NULL ";
$q.= "WHERE ID = " . $base_id;
$dbh->exec($q);
$out_of_date_time = gmdate("Y-m-d", intval($details["OutOfDateTS"]));
- pkgreq_close($request_id, "accepted",
- "The package base has been flagged out-of-date " .
- "since " . $out_of_date_time . ".", true);
}
return array(true, __("Added request successfully."));