1 use Sesse::pr0n::Common;
2 use Sesse::pr0n::Listing;
3 use Sesse::pr0n::Index;
4 use Sesse::pr0n::Image;
5 use Sesse::pr0n::Single;
6 use Sesse::pr0n::Rotate;
7 use Sesse::pr0n::Select;
8 use Sesse::pr0n::WebDAV;
9 use Sesse::pr0n::NewEvent;
11 package Sesse::pr0n::pr0n;
20 return Sesse::pr0n::Listing::handler($r);
21 } elsif ($uri eq '/robots.txt' ||
22 $uri eq '/pr0n.css' ||
23 $uri eq '/skoyen.css' ||
24 $uri eq '/blah.png' ||
25 $uri eq '/faq.html' ||
26 $uri =~ m#^/usage/([a-zA-Z0-9_.]+)$#) {
28 $r->content_type(Sesse::pr0n::Common::get_mimetype_from_filename($uri));
29 $r->sendfile(Sesse::pr0n::Common::get_base($r) . $uri);
30 return Apache2::Const::OK;
31 } elsif ($uri eq '/newevent.html') {
32 $r->content_type('text/html; charset=utf-8');
33 $r->sendfile(Sesse::pr0n::Common::get_base($r) . "newevent.html");
34 return Apache2::Const::OK;
35 } elsif ($uri =~ m#^/webdav#) {
36 return Sesse::pr0n::WebDAV::handler($r);
37 } elsif ($uri =~ m#^/usage/([a-zA-Z0-9.-]+)$#) {
38 $r->sendfile(Sesse::pr0n::Common::get_base($r) . "usage/$1");
39 return Apache2::Const::OK;
40 } elsif ($uri =~ m#^/single/?$#) {
41 return Sesse::pr0n::Single::handler($r);
42 } elsif ($uri =~ m#^/rotate$#) {
43 return Sesse::pr0n::Rotate::handler($r);
44 } elsif ($uri =~ m#^/select$#) {
45 return Sesse::pr0n::Select::handler($r);
46 } elsif ($uri =~ m#^/newevent$#) {
47 return Sesse::pr0n::NewEvent::handler($r);
48 } elsif ($uri =~ m#^/[a-zA-Z0-9-]+/?$#) {
49 return Sesse::pr0n::Index::handler($r);
50 } elsif ($uri =~ m#^/[a-zA-Z0-9-]+/(\d+x\d+/)?(nobox/)?[a-zA-Z0-9._-]+$#) {
51 return Sesse::pr0n::Image::handler($r);
55 Sesse::pr0n::Common::header($r, "404 File Not Found");
56 $r->print(" <p>The file you requested was not found.</p>");
57 Sesse::pr0n::Common::footer($r);
58 return Apache2::Const::OK;