summaryrefslogtreecommitdiffstats
path: root/web/lib/pkgfuncs.inc.php
diff options
context:
space:
mode:
authorLukas Fleischer <archlinux@cryptocrack.de>2012-09-30 23:37:29 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2012-10-03 00:21:21 +0200
commite9ed60566ee24134d79e7935fcdaf25e97fb3f6b (patch)
tree08dc76843b7f412b3c3fae0aa79250dbebeb0677 /web/lib/pkgfuncs.inc.php
parente2f3bee01ee1880e7d3c161fed910651979fb4cc (diff)
downloadaur-e9ed60566ee24134d79e7935fcdaf25e97fb3f6b.tar.gz
aur-e9ed60566ee24134d79e7935fcdaf25e97fb3f6b.tar.xz
Do not notify if status is unchanged in pkg_flag()
Check if a package actually changed its status before sending an email to prevent from spamming. Addresses FS#31745. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/lib/pkgfuncs.inc.php')
-rw-r--r--web/lib/pkgfuncs.inc.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/lib/pkgfuncs.inc.php b/web/lib/pkgfuncs.inc.php
index 6a7cbb57..06f348c5 100644
--- a/web/lib/pkgfuncs.inc.php
+++ b/web/lib/pkgfuncs.inc.php
@@ -699,9 +699,13 @@ function pkg_flag ($atype, $ids, $action=true, $dbh=NULL) {
$q.= "AND MaintainerUID = " . uid_from_sid($_COOKIE["AURSID"], $dbh);
}
- $dbh->exec($q);
-
if ($action) {
+ $q.= " AND OutOfDateTS IS NULL";
+ }
+
+ $affected_pkgs = $dbh->exec($q);
+
+ if ($action && $affected_pkgs > 0) {
# Notify of flagging by email
$f_name = username_from_sid($_COOKIE['AURSID'], $dbh);
$f_email = email_from_sid($_COOKIE['AURSID'], $dbh);