projects
/
pr0n
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c984364
)
Remove the "single" debugging code that has probably been there for ages and
author
Steinar H. Gunderson
<sesse@debian.org>
Thu, 26 Jul 2007 00:09:30 +0000
(
02:09
+0200)
committer
Steinar H. Gunderson
<sesse@debian.org>
Thu, 26 Jul 2007 00:09:30 +0000
(
02:09
+0200)
allowed free access to all pictures. Ouch! =)
perl/Sesse/pr0n/Image.pm
patch
|
blob
|
history
diff --git
a/perl/Sesse/pr0n/Image.pm
b/perl/Sesse/pr0n/Image.pm
index d1743b41d5c456428e4ce78cf0a19e803f0ff065..7f3e3c09825a015f9295c40f2541c2c53dea60a6 100644
(file)
--- a/
perl/Sesse/pr0n/Image.pm
+++ b/
perl/Sesse/pr0n/Image.pm
@@
-34,26
+34,20
@@
sub handler {
}
my ($id, $dbwidth, $dbheight);
}
my ($id, $dbwidth, $dbheight);
- if ($event eq 'single' && $filename =~ /^(\d+)\.jpeg$/) {
- $id = $1;
- } else {
- # Alas, we obviously need to do this :-)
- # my $evq = $dbh->prepare('SELECT count(*) AS numev FROM events WHERE id=? AND vhost=?')
- # or die "prepare(): $!";
- # my $ref = $dbh->selectrow_hashref($evq, undef, $event, $r->get_server_name)
- # or dberror($r, "Could not look up $event");
- # $ref->{'numev'} == 1
- # or error($r, "Could not find $event", 404, "File not found");
+ #if ($event eq 'single' && $filename =~ /^(\d+)\.jpeg$/) {
+ # $id = $1;
+ #} else {
-
# Look it up in the database
-
my $ref = $dbh->selectrow_hashref('SELECT id,width,height FROM images WHERE event=? AND vhost=? AND filename=?',
-
undef, $event, $r->get_server_name, $filename);
-
error($r, "Could not find $event/$filename", 404, "File not found") unless (defined($ref));
+ # Look it up in the database
+ my $ref = $dbh->selectrow_hashref('SELECT id,width,height FROM images WHERE event=? AND vhost=? AND filename=?',
+ undef, $event, $r->get_server_name, $filename);
+ error($r, "Could not find $event/$filename", 404, "File not found") unless (defined($ref));
- $id = $ref->{'id'};
- $dbwidth = $ref->{'width'};
- $dbheight = $ref->{'height'};
- }
+ $id = $ref->{'id'};
+ $dbwidth = $ref->{'width'};
+ $dbheight = $ref->{'height'};
+
+ #}
$dbwidth = -1 unless defined($dbwidth);
$dbheight = -1 unless defined($dbheight);
$dbwidth = -1 unless defined($dbwidth);
$dbheight = -1 unless defined($dbheight);