Commit e016a0fa authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 337717: whineatnews.pl sends email to users having "Bugmail Disabled = 1" -…

Bug 337717: whineatnews.pl sends email to users having "Bugmail Disabled = 1" - Patch by Fré©ric Buclin <LpSolit@gmail.com> r=mkanat a=LpSolit
parent 8ec3f6fc
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# #
# Contributor(s): Terry Weissman <terry@mozilla.org> # Contributor(s): Terry Weissman <terry@mozilla.org>
# Joseph Heenan <joseph@heenan.me.uk> # Joseph Heenan <joseph@heenan.me.uk>
# Frédéric Buclin <LpSolit@gmail.com>
# This is a script suitable for running once a day from a cron job. It # This is a script suitable for running once a day from a cron job. It
...@@ -33,6 +34,7 @@ use lib '.'; ...@@ -33,6 +34,7 @@ use lib '.';
use Bugzilla; use Bugzilla;
use Bugzilla::Mailer; use Bugzilla::Mailer;
use Bugzilla::Util; use Bugzilla::Util;
use Bugzilla::User;
# Whining is disabled if whinedays is zero # Whining is disabled if whinedays is zero
exit unless Bugzilla->params->{'whinedays'} >= 1; exit unless Bugzilla->params->{'whinedays'} >= 1;
...@@ -68,9 +70,10 @@ foreach my $bug (@$slt_bugs) { ...@@ -68,9 +70,10 @@ foreach my $bug (@$slt_bugs) {
foreach my $email (sort (keys %bugs)) { foreach my $email (sort (keys %bugs)) {
my $vars = { my $user = new Bugzilla::User({name => $email});
'email' => $email return if $user->email_disabled;
};
my $vars = {'email' => $email};
my @bugs = (); my @bugs = ();
foreach my $i (@{$bugs{$email}}) { foreach my $i (@{$bugs{$email}}) {
......
Markdown is supported
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