From: Steinar H. Gunderson Date: Mon, 5 May 2014 01:07:33 +0000 (+0200) Subject: Remove the now-obsolete upload wizard (it was never much used). X-Git-Url: https://git.sesse.net/?p=pr0n;a=commitdiff_plain;h=3667f51406998e7ea6411a0b5c84c3ad79fb34e9 Remove the now-obsolete upload wizard (it was never much used). --- diff --git a/perl/Sesse/pr0n/Registry.pm b/perl/Sesse/pr0n/Registry.pm deleted file mode 100644 index 4ebd4f7..0000000 --- a/perl/Sesse/pr0n/Registry.pm +++ /dev/null @@ -1,37 +0,0 @@ -# Not related to Apache2::Registry; generates a .reg file for Windows XP to import. - -package Sesse::pr0n::Registry; -use strict; -use warnings; - -use Sesse::pr0n::Common qw(error dberror); -use Apache2::Request; - -sub handler { - my $r = shift; - my $dbh = Sesse::pr0n::Common::get_dbh(); - my $vhost = $r->get_server_name; - chomp (my $desc = Sesse::pr0n::Templates::fetch_template($r, 'wizard-description')); - - $r->content_type("application/octet-stream"); - $r->headers_out->add('Content-disposition' => 'attachment; filename="' . $vhost . '.reg"'); - - $r->print("Windows Registry Editor Version 5.00\r\n\r\n"); - $r->print("[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Currentversion\\Explorer\\PublishingWizard\\PublishingWizard\\Providers\\$vhost]\r\n"); - $r->print("\"Icon\"=\"http://$vhost/pr0n.ico\"\r\n"); - $r->print("\"DisplayName\"=\"$vhost\"\r\n"); - $r->print("\"Description\"=\"$desc\"\r\n"); - $r->print("\"HREF\"=\"http://$vhost/wizard\"\r\n"); - $r->print(""); - $r->print("[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Currentversion\\Explorer\\PublishingWizard\\InternetPhotoPrinting\\Providers\\$vhost]\r\n"); - $r->print("\"Icon\"=\"http://$vhost/pr0n.ico\"\r\n"); - $r->print("\"DisplayName\"=\"$vhost\"\r\n"); - $r->print("\"Description\"=\"$desc\"\r\n"); - $r->print("\"HREF\"=\"http://$vhost/wizard\"\r\n"); - - return Apache2::Const::OK; -} - -1; - - diff --git a/perl/Sesse/pr0n/Wizard.pm b/perl/Sesse/pr0n/Wizard.pm deleted file mode 100644 index a756a76..0000000 --- a/perl/Sesse/pr0n/Wizard.pm +++ /dev/null @@ -1,45 +0,0 @@ -package Sesse::pr0n::Wizard; -use strict; -use warnings; - -use Sesse::pr0n::Common qw(error dberror); -use Apache2::Request; - -sub handler { - my $r = shift; - my $apr = Apache2::Request->new($r); - my $dbh = Sesse::pr0n::Common::get_dbh(); - - # Internal? (Ugly?) - if ($r->get_server_name =~ /internal/ || $r->get_server_name =~ /skoyen\.bilder\.knatten\.com/ || $r->get_server_name =~ /lia\.heimdal\.org/) { - my $user = Sesse::pr0n::Common::check_access($r); - if (!defined($user)) { - return Apache2::Const::OK; - } - } - - # Find events - my $q = $dbh->prepare('SELECT event,date,name FROM events e JOIN last_picture_cache c USING (vhost,event) WHERE vhost=? ORDER BY last_picture DESC') - or dberror($r, "Couldn't list events"); - $q->execute($r->get_server_name) - or dberror($r, "Couldn't get events"); - - $r->content_type('text/html; charset=utf-8'); - $r->print(Sesse::pr0n::Templates::fetch_template($r, 'wizard-header')); - - while (my $ref = $q->fetchrow_hashref()) { - my $id = $ref->{'event'}; - my $date = $ref->{'date'}; - my $name = $ref->{'name'}; - - $r->print(" \n"); - } - - $r->print(Sesse::pr0n::Templates::fetch_template($r, 'wizard-footer')); - - return Apache2::Const::OK; -} - -1; - - diff --git a/perl/Sesse/pr0n/pr0n.pm b/perl/Sesse/pr0n/pr0n.pm index eeb93b0..0372c46 100644 --- a/perl/Sesse/pr0n/pr0n.pm +++ b/perl/Sesse/pr0n/pr0n.pm @@ -6,8 +6,6 @@ use Sesse::pr0n::Rotate; use Sesse::pr0n::Select; use Sesse::pr0n::WebDAV; use Sesse::pr0n::NewEvent; -use Sesse::pr0n::Registry; -use Sesse::pr0n::Wizard; package Sesse::pr0n::pr0n; use strict; @@ -64,10 +62,6 @@ sub handler { return Sesse::pr0n::Select::handler($r); } elsif ($uri =~ m#^/newevent$#) { return Sesse::pr0n::NewEvent::handler($r); - } elsif ($uri =~ m#^/registry$#) { - return Sesse::pr0n::Registry::handler($r); - } elsif ($uri =~ m#^/wizard$#) { - return Sesse::pr0n::Wizard::handler($r); } elsif ($uri =~ /^\/[a-zA-Z0-9-]+\/?$/ || $uri =~ /^\/\+all\/?$/ || $uri =~ /^\/\+tags\/[a-zA-Z0-9-]+\/?$/) {