diff options
author | jake%acutex.net <> | 2001-06-08 22:12:13 +0200 |
---|---|---|
committer | jake%acutex.net <> | 2001-06-08 22:12:13 +0200 |
commit | 0f520772563d9b1a599b7602f01ce88c365a9951 (patch) | |
tree | 3fa6ef54276c74a444408d9907723543524b05e4 | |
parent | 0f98ee7e227b929999275c6cd4eefefb78515932 (diff) | |
download | bugzilla-0f520772563d9b1a599b7602f01ce88c365a9951.tar.gz bugzilla-0f520772563d9b1a599b7602f01ce88c365a9951.tar.xz |
Give a logical error message if no products are available to a user for bug entry (bug 84285).
Patch by Paul Thomas <paul.thomas@sse.ie>
r= jake@acutex.net
-rwxr-xr-x | enter_bug.cgi | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi index 493dcadd3..2df9ca247 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -79,13 +79,13 @@ if (!defined $::FORM{'product'}) { } push(@prodlist, $p); } + if (1 != @prodlist) { print "Content-type: text/html\n\n"; - PutHeader("Enter Bug"); - - print "<H2>First, you must pick a product on which to enter\n"; - print "a bug.</H2>\n"; - print "<table>"; + + my $bProdFlag = 0; + my $tableContents = ""; + foreach my $p (@prodlist) { if (defined $::proddesc{$p} && $::proddesc{$p} eq '0') { # Special hack. If we stuffed a "0" into proddesc, that means @@ -93,6 +93,7 @@ if (!defined $::FORM{'product'}) { # to allow people to specify that product here. next; } + if(Param("usebuggroupsentry") && GroupExists($p) && !UserInGroup($p)) { @@ -101,16 +102,34 @@ if (!defined $::FORM{'product'}) { # group, we don't want to include that product in this list. next; } - print "<tr><th align=right valign=top><a href=\"enter_bug.cgi?product=" . url_quote($p) . "\">$p</a>:</th>\n"; + + $bProdFlag = 1; + $tableContents .= "<tr><th align=right valign=top><a href=\"enter_bug.cgi?product=" . url_quote($p) . "\">$p</a>:</th>\n"; + if (defined $::proddesc{$p}) { - print "<td valign=top>$::proddesc{$p}</td>\n"; + $tableContents .= "<td valign=top>$::proddesc{$p}</td>\n"; } - print "</tr>"; + + $tableContents .= "</tr>"; } - print "</table>\n"; + + # display sensible message if no products were found for the user to enter bugs against + if ($bProdFlag) { + PutHeader("Enter Bug"); + print "<H2>First, you must pick a product on which to enter a bug.</H2>\n"; + print "<table>\n"; + print $tableContents; + print "</table>\n"; + } else { + PutHeader("Permission Denied"); + print "Sorry. There are no products for which you may enter bugs\n"; + print "<P>\n"; + } + PutFooter(); exit; } + $::FORM{'product'} = $prodlist[0]; } |