diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-07-29 17:59:26 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2014-07-29 17:59:26 +0200 |
commit | c70b340c41899926f121a37546f456a2e4608ffc (patch) | |
tree | 45891a9c0374030a2f00e6f1f6e85b44d0fe996b /web/lib/pkgbasefuncs.inc.php | |
parent | 98235c834b08c4528585fb46e0206699ccdbdecb (diff) | |
download | aur-c70b340c41899926f121a37546f456a2e4608ffc.tar.gz aur-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/pkgbasefuncs.inc.php')
-rw-r--r-- | web/lib/pkgbasefuncs.inc.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php index cf0b09b7..946209b7 100644 --- a/web/lib/pkgbasefuncs.inc.php +++ b/web/lib/pkgbasefuncs.inc.php @@ -511,6 +511,16 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via) { } } + /* + * Close package request if the deletion was initiated through the + * request interface. NOTE: This needs to happen *before* the actual + * deletion. Otherwise, the former maintainer will not be included in + * the Cc list of the request notification email. + */ + if ($via) { + pkgreq_close(intval($via), 'accepted', ''); + } + if ($merge_base_id) { /* Merge comments */ $q = "UPDATE PackageComments "; @@ -544,10 +554,6 @@ function pkgbase_delete ($base_ids, $merge_base_id, $via) { $q = "DELETE FROM PackageBases WHERE ID IN (" . implode(",", $base_ids) . ")"; $dbh->exec($q); - if ($via) { - pkgreq_close(intval($via), 'accepted', ''); - } - return array(true, __("The selected packages have been deleted.")); } @@ -579,6 +585,16 @@ function pkgbase_adopt ($base_ids, $action=true, $via) { } } + /* + * Close package request if the disownment was initiated through the + * request interface. 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. + */ + if ($via) { + pkgreq_close(intval($via), 'accepted', ''); + } + $dbh = DB::connect(); $q = "UPDATE PackageBases "; @@ -600,10 +616,6 @@ function pkgbase_adopt ($base_ids, $action=true, $via) { $dbh->exec($q); - if ($via) { - pkgreq_close(intval($via), 'accepted', ''); - } - if ($action) { pkgbase_notify(account_from_sid($_COOKIE["AURSID"]), $base_ids); return array(true, __("The selected packages have been adopted.")); |