summaryrefslogtreecommitdiff
path: root/httemplate/view/attachment.html
diff options
context:
space:
mode:
authormark <mark>2009-08-10 23:04:57 +0000
committermark <mark>2009-08-10 23:04:57 +0000
commitae898cc8e6de40fbecb30c973f91cd955434b159 (patch)
tree958b2684401f62785db16e300764f163bf7c0384 /httemplate/view/attachment.html
parent165423e6ce43f8f87f329330bf92f422e718a768 (diff)
Improve handling of deleted attachments
Diffstat (limited to 'httemplate/view/attachment.html')
-rw-r--r--httemplate/view/attachment.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/httemplate/view/attachment.html b/httemplate/view/attachment.html
index c85b137..5fc0539 100644
--- a/httemplate/view/attachment.html
+++ b/httemplate/view/attachment.html
@@ -1,16 +1,16 @@
+<% $attach->body %>
<%init>
my ($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
my $attachnum = $1 or die 'Invalid attachment number';
$FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'access denied';
-my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die 'Attachment not found: $attachnum';
+my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die "Attachment not found: $attachnum";
+die 'access denied' if $attach->disabled;
$m->clear_buffer;
$r->content_type($attach->mime_type || 'text/plain');
$r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename);
-binmode STDOUT;
-print STDOUT $attach->body;
</%init>