From 96de4d327f1592356971d23cf7daf2346a4c3ec3 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 1 Aug 2008 14:23:31 +0000 Subject: [PATCH] backporting proxy fix from trunk -- cannot reuse a __DATA__ section in mod_perl git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@10230 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm | 65 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm b/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm index c2a79e4f3b..84c8f4d1eb 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm @@ -15,10 +15,41 @@ use OpenSRF::System; # set the bootstrap config and template include directory when # this module is loaded my $bootstrap; +my $ssl_off; + +my $default_template = < + + TITLE + + +


+
+
+ + + + + + + + + + + + +
DESCRIPTION
Username or barcode:
Password:
+ +
+
+ + +HTML sub import { my $self = shift; $bootstrap = shift; + $ssl_off = shift; } @@ -45,7 +76,7 @@ sub handler { my $url = $cgi->url; # push everyone to the secure site - if ($url =~ /^http:/o) { + if (!$ssl_off && $url =~ /^http:/o) { $url =~ s/^http:/https:/o; print "Location: $url\n\n"; return Apache2::Const::OK; @@ -59,7 +90,7 @@ sub handler { print $cgi->header(-type=>'text/html', -expires=>'-1d'); if (!$proxyhtml) { - $proxyhtml = join '', ; + $proxyhtml = $default_template; $proxyhtml =~ s/TITLE/$title/gso; $proxyhtml =~ s/DESCRIPTION/$desc/gso; } else { @@ -147,35 +178,5 @@ sub oils_login { return $response->{payload}->{authtoken}; } - - 1; -__DATA__ - - - TITLE - - -


-
-
- - - - - - - - - - - - -
DESCRIPTION
Username or barcode:
Password:
- -
-
- - - -- 2.11.0