Commit 0d513e14 authored by Lukas Fleischer's avatar Lukas Fleischer
Browse files

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: default avatarLukas Fleischer <archlinux@cryptocrack.de>
parent 707b1bb8
...@@ -99,7 +99,7 @@ if (check_token()) { ...@@ -99,7 +99,7 @@ if (check_token()) {
} elseif (current_action("do_FileRequest")) { } elseif (current_action("do_FileRequest")) {
list($ret, $output) = pkgreq_file($ids, $_POST['type'], $_POST['merge_into'], $_POST['comments']); list($ret, $output) = pkgreq_file($ids, $_POST['type'], $_POST['merge_into'], $_POST['comments']);
} elseif (current_action("do_CloseRequest")) { } elseif (current_action("do_CloseRequest")) {
list($ret, $output) = pkgreq_close($_POST['reqid']); list($ret, $output) = pkgreq_close($_POST['reqid'], false);
} }
if (isset($_REQUEST['comment'])) { if (isset($_REQUEST['comment'])) {
......
...@@ -540,7 +540,7 @@ function pkgbase_delete ($atype, $base_ids, $merge_base_id, $via) { ...@@ -540,7 +540,7 @@ function pkgbase_delete ($atype, $base_ids, $merge_base_id, $via) {
$dbh->exec($q); $dbh->exec($q);
if ($via) { if ($via) {
pkgreq_close(intval($via)); pkgreq_close(intval($via), true);
} }
return array(true, __("The selected packages have been deleted.")); return array(true, __("The selected packages have been deleted."));
...@@ -598,7 +598,7 @@ function pkgbase_adopt ($atype, $base_ids, $action=true, $via) { ...@@ -598,7 +598,7 @@ function pkgbase_adopt ($atype, $base_ids, $action=true, $via) {
$dbh->exec($q); $dbh->exec($q);
if ($via) { if ($via) {
pkgreq_close(intval($via)); pkgreq_close(intval($via), true);
} }
if ($action) { if ($action) {
......
...@@ -126,10 +126,11 @@ function pkgreq_file($ids, $type, $merge_into, $comments) { ...@@ -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_LOCATION The AUR's URL used for notification e-mails
* @global string $AUR_REQUEST_ML The request notification mailing list * @global string $AUR_REQUEST_ML The request notification mailing list
* @param int $id The package request to close * @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 * @return array Tuple of success/failure indicator and error message
*/ */
function pkgreq_close($id) { function pkgreq_close($id, $accepted) {
global $AUR_LOCATION; global $AUR_LOCATION;
global $AUR_REQUEST_ML; global $AUR_REQUEST_ML;
...@@ -167,7 +168,9 @@ function pkgreq_close($id) { ...@@ -167,7 +168,9 @@ function pkgreq_close($id) {
* user who posted the comment was in. * user who posted the comment was in.
*/ */
$username = username_from_sid($_COOKIE['AURSID']); $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"; "[1] " . $AUR_LOCATION . get_user_uri($username) . "\n";
$body = wordwrap($body, 70); $body = wordwrap($body, 70);
$headers = "MIME-Version: 1.0\r\n" . $headers = "MIME-Version: 1.0\r\n" .
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment