summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-08-15 23:38:53 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-08-15 23:38:53 +0200
commit5bcba2b42c531a50c0017a262e879b0b42940b53 (patch)
tree4d634d115ef3a0785aebf77b3ab770f805a0a5d1
parent85aaf45b9086e8017631c0f0fc4d013fca2fbd93 (diff)
downloadbugzilla-5bcba2b42c531a50c0017a262e879b0b42940b53.tar.gz
bugzilla-5bcba2b42c531a50c0017a262e879b0b42940b53.tar.xz
Bug 782330 - Whine emails show the summary of security sensitive bugs
r=gerv
-rw-r--r--extensions/SecureMail/Extension.pm21
-rwxr-xr-xwhine.pl3
2 files changed, 24 insertions, 0 deletions
diff --git a/extensions/SecureMail/Extension.pm b/extensions/SecureMail/Extension.pm
index 64496a929..2138864e0 100644
--- a/extensions/SecureMail/Extension.pm
+++ b/extensions/SecureMail/Extension.pm
@@ -550,4 +550,25 @@ sub _filter_bug_links {
});
}
+sub whine_before_send {
+ my ($self, $args) = @_;
+ my $params = $args->{params};
+
+ return if !exists $params->{queries};
+
+ foreach my $query (@{ $params->{queries} }) {
+ foreach my $bug (@{ $query->{bugs} }) {
+ my $bug_obj = new Bugzilla::Bug($bug->{bug_id});
+ next if !_should_secure_bug($bug_obj);
+ $bug->{priority} = '--';
+ $bug->{bug_severity} = '--';
+ $bug->{rep_platform} = '--';
+ $bug->{assigned_to} = '--';
+ $bug->{bug_status} = '--';
+ $bug->{resolution} = '--';
+ $bug->{'short_desc'} = "(Secure bug)";
+ }
+ }
+}
+
__PACKAGE__->NAME;
diff --git a/whine.pl b/whine.pl
index ad6067228..7e02a64e7 100755
--- a/whine.pl
+++ b/whine.pl
@@ -35,6 +35,7 @@ use Bugzilla::User;
use Bugzilla::Mailer;
use Bugzilla::Util;
use Bugzilla::Group;
+use Bugzilla::Hook;
# create some handles that we'll need
my $template = Bugzilla->template;
@@ -367,6 +368,8 @@ sub mail {
# Don't send mail to someone whose bugmail notification is disabled.
return if $addressee->email_disabled;
+ Bugzilla::Hook::process('whine_before_send', { params => $args });
+
my $template = Bugzilla->template_inner($addressee->setting('lang'));
my $msg = ''; # it's a temporary variable to hold the template output
$args->{'alternatives'} ||= [];