summaryrefslogtreecommitdiffstats
path: root/extensions/BugmailFilter
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-08-18 05:33:56 +0200
committerByron Jones <glob@mozilla.com>2015-08-18 05:33:56 +0200
commit8dd0fac8172ddc089d8972718ac79b6c5965bc7e (patch)
treed7395d191d1e02dafb77c605a7bd46ed80468f03 /extensions/BugmailFilter
parent3dae100b6b7dd2db8c2fed80c9c1b68c07140894 (diff)
downloadbugzilla-8dd0fac8172ddc089d8972718ac79b6c5965bc7e.tar.gz
bugzilla-8dd0fac8172ddc089d8972718ac79b6c5965bc7e.tar.xz
Bug 1195593 - Able to delete any Bugzilla user's Bugmail Filter
Diffstat (limited to 'extensions/BugmailFilter')
-rw-r--r--extensions/BugmailFilter/Extension.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/extensions/BugmailFilter/Extension.pm b/extensions/BugmailFilter/Extension.pm
index 4cbf3d984..dc38e8577 100644
--- a/extensions/BugmailFilter/Extension.pm
+++ b/extensions/BugmailFilter/Extension.pm
@@ -98,11 +98,12 @@ sub user_preferences {
my $ids = ref($input->{remove}) ? $input->{remove} : [ $input->{remove} ];
my $dbh = Bugzilla->dbh;
+ my $user = Bugzilla->user;
+
+ my $filters = Bugzilla::Extension::BugmailFilter::Filter->match({ id => $ids, user_id => $user->id });
$dbh->bz_start_transaction;
- foreach my $id (@$ids) {
- if (my $filter = Bugzilla::Extension::BugmailFilter::Filter->new($id)) {
- $filter->remove_from_db();
- }
+ foreach my $filter (@$filters) {
+ $filter->remove_from_db();
}
$dbh->bz_commit_transaction;
}