From 429456196dd7ce8ef7e0876b7e57cdc394a228ba Mon Sep 17 00:00:00 2001 From: "myk%mozilla.org" <> Date: Wed, 30 Jan 2002 22:14:10 +0000 Subject: Fix for bug 104521: Removes old attachment interface in favor of new attachment tracker. Patch by Myk Melez . r=bbaetz,kiko --- showattachment.cgi | 43 +++++++------------------------------------ 1 file changed, 7 insertions(+), 36 deletions(-) (limited to 'showattachment.cgi') diff --git a/showattachment.cgi b/showattachment.cgi index 70f5c6d66..4aaf6f17d 100755 --- a/showattachment.cgi +++ b/showattachment.cgi @@ -28,39 +28,10 @@ use lib qw(.); require "CGI.pl"; -if (!defined $::FORM{'attach_id'}) { - print "Content-type: text/html\n"; - print "\n"; - PutHeader("Search by attachment number"); - print "
\n"; - print "You may view a single attachment by entering its id here: \n"; - print "\n"; - print "\n"; - print "
\n"; - PutFooter(); - exit; -} - -ConnectToDatabase(); - -quietly_check_login(); - -if (!detaint_natural($::FORM{attach_id})) { - DisplayError("Attachment ID should be numeric."); - exit; -} - -SendSQL("select bug_id, mimetype, thedata from attachments where attach_id = $::FORM{'attach_id'}"); -my ($bug_id, $mimetype, $thedata) = FetchSQLData(); - -if (!$bug_id) { - DisplayError("Attachment $::FORM{attach_id} does not exist."); - exit; -} - -# Make sure the user can see the bug to which this file is attached -ValidateBugID($bug_id); - -print qq{Content-type: $mimetype\n\n$thedata}; - - +# Redirect to the new interface for displaying attachments. +detaint_natural($::FORM{'attach_id'}) if defined($::FORM{'attach_id'}); +my $id = $::FORM{'attach_id'} || ""; +print "Status: 301 Permanent Redirect\n"; +print "Location: attachment.cgi?id=$id&action=view\n\n"; +exit; + -- cgit v1.2.3-24-g4f1b