[open-ils-commits] r10301 -
branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/WWW
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Aug 7 11:22:43 EDT 2008
Author: erickson
Date: 2008-08-07 11:22:37 -0400 (Thu, 07 Aug 2008)
New Revision: 10301
Modified:
branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
Log:
preserve the entire url with query string in redirects
Modified: branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm
===================================================================
--- branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm 2008-08-07 15:08:26 UTC (rev 10300)
+++ branches/rel_1_2_3/Open-ILS/src/perlmods/OpenILS/WWW/Proxy.pm 2008-08-07 15:22:37 UTC (rev 10301)
@@ -77,8 +77,9 @@
# push everyone to the secure site
if (!$ssl_off && $url =~ /^http:/o) {
- $url =~ s/^http:/https:/o;
- print "Location: $url\n\n";
+ my $base = $cgi->url(-base=>1);
+ $base =~ s/^http:/https:/o;
+ print "Location: $base".$apache->unparsed_uri."\n\n";
return Apache2::Const::OK;
}
@@ -104,7 +105,7 @@
$auth_ses = oils_login($u, $p, $ltype);
if ($auth_ses) {
print $cgi->redirect(
- -uri=>$url,
+ -uri=> $apache->unparsed_uri,
-cookie=>$cgi->cookie(
-name=>'ses',
-value=>$auth_ses,
@@ -113,12 +114,12 @@
);
return Apache2::Const::REDIRECT;
} else {
- return back_to_login($cgi);
+ return back_to_login($apache, $cgi);
}
}
my $user = verify_login($auth_ses);
- return back_to_login($cgi) unless $user;
+ return back_to_login($apache, $cgi) unless $user;
$ws_ou ||= $user->home_ou;
@@ -129,16 +130,17 @@
->request('open-ils.actor.user.perm.check', $auth_ses, $user->id, $ws_ou, $perms)
->gather(1);
- return back_to_login($cgi) if (@$failures > 0);
+ return back_to_login($apache, $cgi) if (@$failures > 0);
# they're good, let 'em through
return Apache2::Const::DECLINED;
}
sub back_to_login {
+ my $apache = shift;
my $cgi = shift;
print $cgi->redirect(
- -uri=>$cgi->url,
+ -uri=>$apache->unparsed_uri,
-cookie=>$cgi->cookie(
-name=>'ses',
-value=>'',
More information about the open-ils-commits
mailing list