summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2014-06-25 21:51:53 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2014-06-25 21:54:36 +0200
commit278e6be4eb0de0239196b94dce20822dbb91a2b5 (patch)
tree69034b992d1f11a46d4603fde2009baa3c53e787
parentc8818a693d2d6b3639509d75b5118d67ea92a74b (diff)
Prefix request notification mails with ID
Add a "[PRQ#n]" prefix to each package request notification mail. PRQ is an abbreviation for "Package Request" and n is replaced with the corresponding package request ID. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
-rw-r--r--web/lib/pkgbasefuncs.inc.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/lib/pkgbasefuncs.inc.php b/web/lib/pkgbasefuncs.inc.php
index 339cd7e..9f3439d 100644
--- a/web/lib/pkgbasefuncs.inc.php
+++ b/web/lib/pkgbasefuncs.inc.php
@@ -1084,8 +1084,9 @@ function pkgbase_file_request($ids, $type, $merge_into, $comments) {
"In-Reply-To: $thread_id\r\n" .
"References: $thread_id\r\n" .
"X-Mailer: AUR";
- @mail($AUR_REQUEST_ML, "AUR " . ucfirst($type) . " Request for " .
- $row['Name'], $body, $headers);
+ @mail($AUR_REQUEST_ML, "[PRQ#" . $request_id . "] " . ucfirst($type) .
+ " Request for " . $row['Name'], $body,
+ $headers);
return array(true, __("Added request successfully."));
}
@@ -1104,6 +1105,7 @@ function pkgbase_close_request($id) {
global $AUR_REQUEST_ML;
$dbh = DB::connect();
+ $id = intval($id);
if (!check_user_privileges()) {
return array(false, __("Only TUs and developers can close requests."));
@@ -1121,7 +1123,7 @@ function pkgbase_close_request($id) {
$q.= "ON PackageBases.MaintainerUID = Users.ID ";
$q.= "INNER JOIN PackageRequests ";
$q.= "ON PackageRequests.PackageBaseID = PackageBases.ID ";
- $q.= "WHERE PackageRequests.ID = " . intval($id);
+ $q.= "WHERE PackageRequests.ID = " . $id;
$result = $dbh->query($q);
if ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$bcc = $row['Email'];
@@ -1150,7 +1152,8 @@ function pkgbase_close_request($id) {
"In-Reply-To: $thread_id\r\n" .
"References: $thread_id\r\n" .
"X-Mailer: AUR";
- @mail($AUR_REQUEST_ML, "AUR Request Closed", $body, $headers);
+ @mail($AUR_REQUEST_ML, "[PRQ#" . $id . "] Request Closed", $body,
+ $headers);
return array(true, __("Request closed successfully."));
}