summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-07-01 20:06:41 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-07-01 20:06:41 +0200
commit0d513e1468d3f37ebdc4e237ccb1855fc6d273a2 (patch)
tree65cfb3988e0ff92eabd5dde309bb87fc4aeba76c /web/lib
parent707b1bb8788a272f0365baf99d9ef539655939a8 (diff)
downloadaur-0d513e1468d3f37ebdc4e237ccb1855fc6d273a2.tar.gz
aur-0d513e1468d3f37ebdc4e237ccb1855fc6d273a2.tar.xz
Be explicit about accepted requests in emails
When sending notification emails after closing a request, be explicit about whether the request has been accepted or not. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/pkgbasefuncs.inc.php4
-rw-r--r--web/lib/pkgreqfuncs.inc.php7
2 files changed, 7 insertions, 4 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 32c2d9b6..0ee2c313 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -540,7 +540,7 @@ function pkgbase_delete ($atype, $base_ids, $merge_base_id, $via) {
$dbh->exec($q);
if ($via) {
- pkgreq_close(intval($via));
+ pkgreq_close(intval($via), true);
}
return array(true, __("The selected packages have been deleted."));
@@ -598,7 +598,7 @@ function pkgbase_adopt ($atype, $base_ids, $action=true, $via) {
$dbh->exec($q);
if ($via) {
- pkgreq_close(intval($via));
+ pkgreq_close(intval($via), true);
}
if ($action) {
diff --git a/web/lib/pkgreqfuncs.inc.php b/web/lib/pkgreqfuncs.inc.php
index 69ba08d4..26d543eb 100644
--- a/web/lib/pkgreqfuncs.inc.php
+++ b/web/lib/pkgreqfuncs.inc.php
@@ -126,10 +126,11 @@ function pkgreq_file($ids, $type, $merge_into, $comments) {
* @global string $AUR_LOCATION The AUR's URL used for notification e-mails
* @global string $AUR_REQUEST_ML The request notification mailing list
* @param int $id The package request to close
+ * @param bool $accepted True if the request has been accepted, false otherwise
*
* @return array Tuple of success/failure indicator and error message
*/
-function pkgreq_close($id) {
+function pkgreq_close($id, $accepted) {
global $AUR_LOCATION;
global $AUR_REQUEST_ML;
@@ -167,7 +168,9 @@ function pkgreq_close($id) {
* user who posted the comment was in.
*/
$username = username_from_sid($_COOKIE['AURSID']);
- $body = $username . " [1] closed request #" . intval($id) . ".\n\n" .
+ $body = "Request #" . intval($id) . " has been " .
+ ($accepted ? "accepted" : "closed") . " by " .
+ $username . " [1].\n\n" .
"[1] " . $AUR_LOCATION . get_user_uri($username) . "\n";
$body = wordwrap($body, 70);
$headers = "MIME-Version: 1.0\r\n" .