From: lpsolit%gmail.com <> Date: Wed, 4 Jul 2007 03:33:00 +0000 (+0000) Subject: Bug 337717: whineatnews.pl sends email to users having "Bugmail Disabled = 1" - Patch... X-Git-Tag: bugzilla-3.0.1~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46581cd88c132eb6e6a9d0a8c6dc2a14ea39e211;p=thirdparty%2Fbugzilla.git Bug 337717: whineatnews.pl sends email to users having "Bugmail Disabled = 1" - Patch by Frédéric Buclin r=mkanat a=LpSolit --- diff --git a/whineatnews.pl b/whineatnews.pl index 42df7be556..c6ab20af5d 100755 --- a/whineatnews.pl +++ b/whineatnews.pl @@ -20,6 +20,7 @@ # # Contributor(s): Terry Weissman # Joseph Heenan +# Frédéric Buclin # This is a script suitable for running once a day from a cron job. It @@ -33,6 +34,7 @@ use lib '.'; use Bugzilla; use Bugzilla::Mailer; use Bugzilla::Util; +use Bugzilla::User; # Whining is disabled if whinedays is zero exit unless Bugzilla->params->{'whinedays'} >= 1; @@ -68,9 +70,10 @@ foreach my $bug (@$slt_bugs) { foreach my $email (sort (keys %bugs)) { - my $vars = { - 'email' => $email - }; + my $user = new Bugzilla::User({name => $email}); + return if $user->email_disabled; + + my $vars = {'email' => $email}; my @bugs = (); foreach my $i (@{$bugs{$email}}) {