Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Rename Combust::Control::Redirect to PerlOrg::Control::Books

  • Loading branch information...
commit 0ef3daaa3b6dc2ccb58c9d88a81ba3348e5c4507 1 parent d34d03f
@abh authored
View
2  apache/conf/sites/com.tmpl
@@ -15,7 +15,7 @@
<Location /redirect/>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /server-status>
View
2  apache/conf/sites/dev.tmpl
@@ -14,7 +14,7 @@
<Location /redirect/>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /error/>
View
2  apache/conf/sites/learn.tmpl
@@ -15,7 +15,7 @@
<Location /redirect>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /server-status>
View
2  apache/conf/sites/lists.tmpl
@@ -15,7 +15,7 @@
<Location /redirect/>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /error/>
View
2  apache/conf/sites/parrotcode.tmpl
@@ -6,7 +6,7 @@
<Location /redirect/>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /error/>
View
2  apache/conf/sites/www.tmpl
@@ -17,7 +17,7 @@
<Location /redirect/>
SetHandler perl-script
- PerlHandler Combust::Control::Redirect->super
+ PerlHandler +PerlOrg::Control::Books->super
</Location>
<Location /search>
View
1  apache/conf/startup.pl
@@ -7,7 +7,6 @@ BEGIN
use strict;
use Apache::DBI;
use Data::Dumper;
-use Combust::Control::Redirect;
use Combust::Control::Basic;
use Combust::Control::Error;
use Combust::Notes;
View
18 lib/Combust/Control/Redirect.pm → lib/PerlOrg/Control/Books.pm
@@ -1,18 +1,11 @@
-package Combust::Control::Redirect;
+package PerlOrg::Control::Books;
use strict;
use base 'Combust::Control';
-# this should really be more extensible and dispatch to subclasses
-# instead of hardcoding things here.
-
my %bookstores =
( 'amazon' => 'http://www.amazon.com/exec/obidos/ASIN/#ISBN#/develooper',
'amazonuk' => 'http://www.amazon.co.uk/exec/obidos/ASIN/#ISBN#/develooper-21',
- 'fatbrain' => 'http://www1.fatbrain.com/asp/bookinfo/bookinfo.asp?theisbn=#ISBN#&from=VFK102',
- 'bn' => 'http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38537477&bfpid=#ISBN#&bfmtype=book',
'powells' => 'http://www.powells.com/partner/25774/biblio/#ISBN#',
- # bookpool appears to have gone under
- 'bookpool' => 'http://www.bookpool.com/.x/SSSSSS_C200/sm/#ISBN#',
);
my %sites =
@@ -41,7 +34,7 @@ sub find_url {
# can't use straight URLs, because they let us become an open
# bouncepoint for things. So.. we've got to code sites.
# Eventually this should be in a .ht file or something.
- die "Uniknown Site"
+ die "Unknown Site"
unless exists $sites{ $self->req_param('id') };
return $sites{ $self->req_param('id') };
}
@@ -49,8 +42,8 @@ sub find_url {
}
-sub render ($$) {
- my ($self) = @_;
+sub render {
+ my $ self = shift;
my $url;
eval { $url = $self->find_url() };
@@ -60,10 +53,7 @@ sub render ($$) {
return $self->redirect($url);
}
else {
- # If we can't handle it, pass it to CC::Error, which will default
- # to a 404.
return 404;
- # return $self->Combust::Control::Error::render();
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.