Skip to content

Commit

Permalink
Saving name change
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianAker committed Feb 21, 2003
1 parent f21321b commit 7c09c0b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions plugins/Blob/blob.pl
Expand Up @@ -7,6 +7,7 @@
use strict;
use Slash;
use Slash::Search;
use Slash::Blob;
use Slash::Display;
use Slash::Utility;
use Slash::XML;
Expand All @@ -19,17 +20,19 @@ sub main {
my $blob = getObject("Slash::Blob", { db_type => 'reader' });

unless ($form->{id}) {
redirect("404.pl");
redirect("/404.pl");
return;
}

my $data = $blob->get($form->{id});
if (!$data || $user->{seclev} < $data->{seclev}) {
redirect("404.pl");
redirect("/404.pl");
return;
}

my $r = Apache->request;
$r->header_out('Cache-Control', 'private');
$r->content_type($data->{mime_type});
$r->content_type($data->{content_type});
$r->status(200);
$r->send_http_header;
$r->rflush;
Expand Down
2 changes: 1 addition & 1 deletion plugins/Blob/blobLoader
Expand Up @@ -40,7 +40,7 @@ while (<$file>) {
close($file);
my $id = $blobs->create({
seclev => $opts{s},
mime_type => $opts{c},
content_type => $opts{c},
data => $data,
});
print "Stored in $id\n";
Expand Down
2 changes: 1 addition & 1 deletion plugins/Blob/mysql_schema
@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS blobs;
CREATE TABLE blobs (
id VARCHAR(32) NOT NULL,
mime_type VARCHAR(80) NOT NULL,
content_type VARCHAR(80) NOT NULL,
seclev mediumint UNSIGNED NOT NULL DEFAULT '0',
reference_count mediumint UNSIGNED NOT NULL DEFAULT '1',
data LONGBLOB NOT NULL,
Expand Down

0 comments on commit 7c09c0b

Please sign in to comment.