summaryrefslogtreecommitdiffstats
path: root/web/html/packages.php
diff options
context:
space:
mode:
authortardo <tardo@nagi-fanboi.net>2007-09-22 18:08:14 -0400
committertardo <tardo@nagi-fanboi.net>2007-09-22 18:08:14 -0400
commit4548b0d08b592180bd4cd66ec127d0069f27c792 (patch)
tree0328e9336cafaad260a7f128f807790fc4dc2db7 /web/html/packages.php
parentadafc112f6f14a5ab7249a622da5d74a8f52a3ed (diff)
downloadaurweb-4548b0d08b592180bd4cd66ec127d0069f27c792.tar.xz
Notify by email when package is flagged out of date. FS 3231.
In addition to the above, it does not notify if the user that flags package out of date is the same as the owner of the package. The body of the email could use work as well I suppose. Signed-off-by: tardo <tardo@nagi-fanboi.net>
Diffstat (limited to 'web/html/packages.php')
-rw-r--r--web/html/packages.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/web/html/packages.php b/web/html/packages.php
index 4cb8c47..0559060 100644
--- a/web/html/packages.php
+++ b/web/html/packages.php
@@ -66,6 +66,27 @@ if (isset($_REQUEST["do_Flag"])) {
print "<p>\n";
print __("The selected packages have been flagged out-of-date.");
print "</p>\n";
+
+ # notification by tardo.
+ $f_name = username_from_sid($_COOKIE['AURSID']);
+ $f_email = email_from_sid($_COOKIE['AURSID']);
+ $f_uid = uid_from_sid($_COOKIE['AURSID']);
+ $q = "SELECT Packages.Name, Users.Email, Packages.ID ";
+ $q.= "FROM Packages, Users ";
+ $q.= "WHERE Packages.ID IN (" . $flag .") ";
+ $q.= "AND Users.ID = Packages.MaintainerUID ";
+ $q.= "AND Users.ID != " . $f_uid;
+ $result = db_query($q, $dbh);
+ if (mysql_num_rows($result)) {
+ while ($row = mysql_fetch_assoc($result)) {
+ # construct email
+ $body = "Your package " . $row['Name'] . " has been flagged out of date by " . $f_name . ". You may view your package at:\nhttp://aur.archlinux.org/packages.php?do_Details=1&ID=" . $row['ID'];
+ $body = wordwrap($body, 70);
+ $headers = "To: ".$row['Email']."\nReply-to: nobody@archlinux.org\nFrom:aur-notify@archlinux.org\nX-Mailer: PHP\nX-MimeOLE: Produced By AUR\n";
+ @mail(' ', "AUR Out-of-date Notification for ".$row['Name'], $body, $headers);
+ }
+ }
+
} else {
print "<p>\n";
print __("You did not select any packages to flag.");