summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Flag.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-07-22 07:19:19 +0200
committerByron Jones <bjones@mozilla.com>2013-07-22 07:19:19 +0200
commitf10990783862250ca80e96ac5e8a500bed0ee636 (patch)
tree479e389968f523d82ab6b0ac973c9fe5b45cf60a /Bugzilla/Flag.pm
parentca9d0d9120c56b0aa3c3cadcb4759768140cc947 (diff)
downloadbugzilla-f10990783862250ca80e96ac5e8a500bed0ee636.tar.gz
bugzilla-f10990783862250ca80e96ac5e8a500bed0ee636.tar.xz
Bug 850986: don't allow setting a flag's requestee to a disabled account
r=dkl, a=justdave
Diffstat (limited to 'Bugzilla/Flag.pm')
-rw-r--r--Bugzilla/Flag.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 98029a1b1..e1e75f832 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -668,9 +668,14 @@ sub _check_requestee {
# is specifically requestable. For existing flags, if the requestee
# was set before the flag became specifically unrequestable, the
# user can either remove him or leave him alone.
- ThrowUserError('flag_requestee_disabled', { type => $self->type })
+ ThrowUserError('flag_type_requestee_disabled', { type => $self->type })
if !$self->type->is_requesteeble;
+ # You can't ask a disabled account, as they don't have the ability to
+ # set the flag.
+ ThrowUserError('flag_requestee_disabled', { requestee => $requestee })
+ if !$requestee->is_enabled;
+
# Make sure the requestee can see the bug.
# Note that can_see_bug() will query the DB, so if the bug
# is being added/removed from some groups and these changes