[open-ils-commits] r10230 - branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/WWW

svn at svn.open-ils.org svn at svn.open-ils.org
Fri Aug 1 10:23:38 EDT 2008


Author: miker
Date: 2008-08-01 10:23:31 -0400 (Fri, 01 Aug 2008)
New Revision: 10230

Modified:
   branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
Log:
backporting proxy fix from trunk -- cannot reuse a __DATA__ section in mod_perl

Modified: branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
===================================================================
--- branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm	2008-08-01 02:47:39 UTC (rev 10229)
+++ branches/rel_1_2/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm	2008-08-01 14:23:31 UTC (rev 10230)
@@ -15,10 +15,41 @@
 # set the bootstrap config and template include directory when 
 # this module is loaded
 my $bootstrap;
+my $ssl_off;
 
+my $default_template = <<HTML;
+<html>
+	<head>
+		<title>TITLE</title>
+	</head>
+	<body>
+		<br/><br/><br/>
+		<center>
+		<form method='POST'>
+			<table style='border-collapse: collapse; border: 1px solid black;'>
+				<tr>
+					<th colspan='2' align='center'><u>DESCRIPTION</u></th>
+				</tr>
+				<tr>
+					<th align="right">Username or barcode:</th>
+					<td><input type="text" name="user"/></td>
+				</tr>
+				<tr>
+					<th align="right">Password:</th>
+					<td><input type="password" name="passwd"/></td>
+				</tr>
+			</table>
+			<input type="submit" value="Log in"/>
+		</form>
+		</center>
+	</body>
+</html>
+HTML
+
 sub import {
 	my $self = shift;
 	$bootstrap = shift;
+	$ssl_off = shift;
 }
 
 
@@ -45,7 +76,7 @@
 	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 @@
 
 			print $cgi->header(-type=>'text/html', -expires=>'-1d');
 			if (!$proxyhtml) {
-				$proxyhtml = join '', <DATA>;
+				$proxyhtml = $default_template;
 				$proxyhtml =~ s/TITLE/$title/gso;
 				$proxyhtml =~ s/DESCRIPTION/$desc/gso;
 			} else {
@@ -147,35 +178,5 @@
         return $response->{payload}->{authtoken};
 }
 
-
-
 1;
 
-__DATA__
-<html>
-	<head>
-		<title>TITLE</title>
-	</head>
-	<body>
-		<br/><br/><br/>
-		<center>
-		<form method='POST'>
-			<table style='border-collapse: collapse; border: 1px solid black;'>
-				<tr>
-					<th colspan='2' align='center'><u>DESCRIPTION</u></th>
-				</tr>
-				<tr>
-					<th align="right">Username or barcode:</th>
-					<td><input type="text" name="user"/></td>
-				</tr>
-				<tr>
-					<th align="right">Password:</th>
-					<td><input type="password" name="passwd"/></td>
-				</tr>
-			</table>
-			<input type="submit" value="Log in"/>
-		</form>
-		</center>
-	</body>
-</html>
-



More information about the open-ils-commits mailing list