]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Give better error messages when we can't display a bug.
authorterry%mozilla.org <>
Tue, 11 May 1999 05:08:58 +0000 (05:08 +0000)
committerterry%mozilla.org <>
Tue, 11 May 1999 05:08:58 +0000 (05:08 +0000)
bug_form.pl
show_bug.cgi

index 1d7cae19de38d5e3a8a0ee25e8d40dd311b473ea..14ec779a62d0c55922df84d5323936dc0ec68cf4 100644 (file)
@@ -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'});
index 75a3bb8e34ae2b95eedcd5289b6e7bdff32dd8d7..803e1a07e167b3aa855273023e99986fccf921a1 100755 (executable)
 use diagnostics;
 use strict;
 
+require "CGI.pl";
+
+ConnectToDatabase();
+
+if ($::FORM{'GoAheadAndLogIn'}) {
+    confirm_login();
+}
+
 print "Content-type: text/html\n";
 print "\n";
 
-require "CGI.pl";
-
 if (!defined $::FORM{'id'}) {
     print "<H2>Search By Bug Number</H2>\n";
     print "<FORM METHOD=GET ACTION=\"show_bug.cgi\">\n";
@@ -37,8 +43,6 @@ if (!defined $::FORM{'id'}) {
     exit;
 }
 
-ConnectToDatabase();
-
 GetVersionTable();
 
 PutHeader("Bugzilla bug $::FORM{'id'}", "Bugzilla Bug", $::FORM{'id'});