show_bug.cgi 2.33 KB
Newer Older
1 2
#!/usr/bonsaitools/bin/perl -w
# -*- Mode: perl; indent-tabs-mode: nil -*-
terry%netscape.com's avatar
terry%netscape.com committed
3
#
4 5 6 7 8 9 10 11 12 13
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
terry%netscape.com's avatar
terry%netscape.com committed
14
# The Original Code is the Bugzilla Bug Tracking System.
15
#
terry%netscape.com's avatar
terry%netscape.com committed
16
# The Initial Developer of the Original Code is Netscape Communications
17 18 19 20
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
terry%netscape.com's avatar
terry%netscape.com committed
21 22
# Contributor(s): Terry Weissman <terry@mozilla.org>

23 24
use diagnostics;
use strict;
terry%netscape.com's avatar
terry%netscape.com committed
25

26 27 28 29 30 31
require "CGI.pl";

ConnectToDatabase();

if ($::FORM{'GoAheadAndLogIn'}) {
    confirm_login();
32 33
} else {
    quietly_check_login();
34 35
}

36 37 38 39 40 41 42 43 44 45 46 47 48 49
######################################################################
# Begin Data/Security Validation
######################################################################

# Make sure the bug ID is a positive integer representing an existing
# bug that the user is authorized to access.
if (defined ($::FORM{'id'})) {
    ValidateBugID($::FORM{'id'});
}

######################################################################
# End Data/Security Validation
######################################################################

50 51
print "Content-type: text/html\n";
print "\n";
terry%netscape.com's avatar
terry%netscape.com committed
52

53
if (!defined $::FORM{'id'}) {
54
    PutHeader("Search by bug number");
55
    print "<FORM METHOD=GET ACTION=\"show_bug.cgi\">\n";
56
    print "You may find a single bug by entering its bug id here: \n";
57
    print "<INPUT NAME=id>\n";
58 59
    print "<INPUT TYPE=\"submit\" VALUE=\"Show Me This Bug\">\n";
    print "</FORM>\n";
60
    PutFooter();
61
    exit;
terry%netscape.com's avatar
terry%netscape.com committed
62 63
}

64 65
GetVersionTable();

66 67 68 69 70 71 72
# Get the bug's summary (short description) and display it as
# the page title.
SendSQL("SELECT short_desc FROM bugs WHERE bug_id = $::FORM{'id'}");
my ($summary) = FetchSQLData();
$summary = html_quote($summary);
PutHeader("Bug $::FORM{'id'} - $summary", "Bugzilla Bug $::FORM{'id'}", $summary );

73
navigation_header();
terry%netscape.com's avatar
terry%netscape.com committed
74

75
print "<HR>\n";
terry%netscape.com's avatar
terry%netscape.com committed
76

77 78
$! = 0;
do "bug_form.pl" || die "Error doing bug_form.pl: $!";