summaryrefslogtreecommitdiffstats
path: root/bug_form.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>1999-05-11 07:08:58 +0200
committerterry%mozilla.org <>1999-05-11 07:08:58 +0200
commit2adbacb8d2604dc7888216537c248b30cde1128e (patch)
treee95cc07bb2c96b059def284267f12a372b9c91e1 /bug_form.pl
parentfc6da409f24abe6818ddeaaa75e949da369885f1 (diff)
downloadbugzilla-2adbacb8d2604dc7888216537c248b30cde1128e.tar.gz
bugzilla-2adbacb8d2604dc7888216537c248b30cde1128e.tar.xz
Give better error messages when we can't display a bug.
Diffstat (limited to 'bug_form.pl')
-rw-r--r--bug_form.pl27
1 files changed, 19 insertions, 8 deletions
diff --git a/bug_form.pl b/bug_form.pl
index 1d7cae19d..14ec779a6 100644
--- a/bug_form.pl
+++ b/bug_form.pl
@@ -104,7 +104,7 @@ sub quoteUrls {
return $text;
}
-quietly_check_login();
+my $loginok = quietly_check_login();
my $query = "
select
@@ -149,13 +149,24 @@ if (@row = FetchSQLData()) {
$count++;
}
} else {
- my $maintainer = Param("maintainer");
- print "<TITLE>Bug Splat Error</TITLE>\n";
- print "<H1>Query Error</H1>Somehow something went wrong. Possibly if\n";
- print "you mail this page to $maintainer, he will be able to fix\n";
- print "things.<HR>\n";
- print "Bug $::FORM{'id'} not found<H2>Query Text</H2><PRE>$query<PRE>\n";
- exit 0
+ SendSQL("select groupset from bugs where bug_id = $::FORM{'id'}");
+ if (@row = FetchSQLData()) {
+ print "<H1>Permission denied.</H1>\n";
+ if ($loginok) {
+ print "Sorry; you do not have the permissions necessary to see\n";
+ print "bug $::FORM{'id'}.\n";
+ } else {
+ print "Sorry; bug $::FORM{'id'} can only be viewed when logged\n";
+ print "into an account with the appropriate permissions. To\n";
+ print "see this bug, you must first\n";
+ print "<a href=\"show_bug.cgi?id=$::FORM{'id'}&GoAheadAndLogIn=1\">";
+ print "log in</a>.";
+ }
+ } else {
+ print "<H1>Bug not found</H1>\n";
+ print "There does not seem to be a bug numbered $::FORM{'id'}.\n";
+ }
+ exit;
}
$bug{'assigned_to'} = DBID_to_name($bug{'assigned_to'});