]> git.donarmstrong.com Git - debbugs.git/commitdiff
add support for setting the user corresponding to a user tag
authorDon Armstrong <don@volo>
Sat, 21 Oct 2006 08:09:25 +0000 (01:09 -0700)
committerDon Armstrong <don@volo>
Sat, 21 Oct 2006 08:09:25 +0000 (01:09 -0700)
html/Reporting.html.in
scripts/process.in

index 1b42aaed9279b20b852d6509d377bc751a8e1f6f..29fa156e5ce7c1fdbd89d2e8a4ef70354e07931c 100644 (file)
@@ -218,11 +218,14 @@ as described in the
 Separate multiple tags with commas, spaces, or both.
 
 <pre>
+User: &lt;<var>username</var>&gt;
 Usertags: &lt;<var>usertags</var>&gt;
 </pre>
 
-<p>Replace &lt;<var>tags</var>&gt; with one or more usertags. Separate
-multiple tags with commas, spaces, or both.</p>
+<p>Replace &lt;<var>usertags</var>&gt; with one or more usertags.
+Separate multiple tags with commas, spaces, or both. If you specify a
+username, that users tags will be set. Otherwise, the email address of
+the sender will be used as the username</p>
 
 
 <h2>Not forwarding to the mailing list - minor $gBug reports</h2>
index eeb195dfc23b0cb6f82ec292ea83a13980893233..6569260f0514b5fa920433f71b75285c3411f582 100755 (executable)
@@ -651,12 +651,12 @@ END
     # Deal with usertags
     if (exists $pheader{usertags}) {
         my $user = $replyto;
+        $user = $pheader{user} if exists $pheader{user};
         $user =~ s/,.*//;
         $user =~ s/^.*<(.*)>.*$/$1/;
         $user =~ s/[(].*[)]//;
         $user =~ s/^\s*(\S+)\s+.*$/$1/;
-        $user = "" unless (Debbugs::User::is_valid_user($user));
-        if ($user ne '') {
+        if ($user ne '' and Debbugs::User::is_valid_user($user)) {
              $pheader{usertags} =~ s/(?:^\s+|\s+$)//g;
              my %user_tags;
              read_usertags(\%user_tags,$user);
@@ -670,6 +670,12 @@ END
              }
              write_usertags(\%usertags,$user);
         }
+        else {
+             $brokenness .=<<END;
+Your message tried to set a usertag, but didn't have a valid
+user set ('$user' isn't valid)
+END
+        }
     }
     &overwrite("db-h/$hash/$ref.report",
                join("\n",@msg)."\n");