]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 850986: don't allow setting a flag's requestee to a disabled account
authorByron Jones <bjones@mozilla.com>
Mon, 22 Jul 2013 05:19:19 +0000 (13:19 +0800)
committerByron Jones <bjones@mozilla.com>
Mon, 22 Jul 2013 05:19:19 +0000 (13:19 +0800)
r=dkl, a=justdave

Bugzilla/Flag.pm
template/en/default/global/user-error.html.tmpl

index 98029a1b14c31fea9aae611016e4fea1ebb8d813..e1e75f8327aa9828d6ded901f0982fef81b9ca99 100644 (file)
@@ -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
index 6bb0a2baea8948eaf3ff458080476ba4b68957a1..a4c900a22f1a66c2e483fc7f0592c629b5f55a22 100644 (file)
     <br>Alternately, if your attachment is an image, you could convert
     it to a compressible format like JPG or PNG and try again.
 
-  [% ELSIF error == "flag_requestee_disabled" %]
+  [% ELSIF error == "flag_type_requestee_disabled" %]
     [% title = "Flag not Requestable from Specific Person" %]
     You can't ask a specific person for <em>[% type.name FILTER html %]</em>.
 
+  [% ELSIF error == "flag_requestee_disabled" %]
+    [% title = "Flag Requestee Disabled" %]
+    You can't ask <em>[% requestee.identity FILTER html %]</em> because that
+    account is disabled.
+
   [% ELSIF error == "flag_requestee_needs_privs" %]
     [% title = "Flag Requestee Needs Privileges" %]
     [% requestee.identity FILTER html %] does not have permission to set the