From 0f999df035705578df92993c53fe1d37482d73b1 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 19 Jul 2011 12:14:00 +0200 Subject: [PATCH] Bug 7745: Wrong service name for CAS authentification When behind a proxy, Koha give a wrong service name to CAS server (SCRIPT_URI environment variable). It now uses OPACBaseURL syspref. Note: despite the OPACBaseURL description, you have to enter the *full* URL (ie: with http:// or https://) in the syspref. (see Bug 7770) --- C4/Auth_with_cas.pm | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index b096232..e00e3a4 100644 --- a/C4/Auth_with_cas.pm +++ b/C4/Auth_with_cas.pm @@ -66,7 +66,7 @@ sub getMultipleAuth { # Logout from CAS sub logout_cas { my ($query) = @_; - my $uri = $ENV{'SCRIPT_URI'}; + my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name(); my $casparam = $query->param('cas'); # FIXME: This should be more generic and handle whatever parameters there might be $uri .= "?cas=" . $casparam if (defined $casparam); @@ -78,7 +78,7 @@ sub logout_cas { # Login to CAS sub login_cas { my ($query) = @_; - my $uri = $ENV{'SCRIPT_URI'}; + my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name(); my $casparam = $query->param('cas'); # FIXME: This should be more generic and handle whatever parameters there might be $uri .= "?cas=" . $casparam if (defined $casparam); @@ -91,7 +91,7 @@ sub login_cas { sub login_cas_url { my ($query, $key) = @_; - my $uri = $ENV{'SCRIPT_URI'}; + my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name(); my $casparam = $query->param('cas'); # FIXME: This should be more generic and handle whatever parameters there might be $uri .= "?cas=" . $casparam if (defined $casparam); @@ -107,7 +107,7 @@ sub checkpw_cas { $debug and warn "checkpw_cas"; my ($dbh, $ticket, $query) = @_; my $retnumber; - my $uri = $ENV{'SCRIPT_URI'}; + my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name(); my $casparam = $query->param('cas'); # FIXME: This should be more generic and handle whatever parameters there might be $uri .= "?cas=" . $casparam if (defined $casparam); @@ -157,7 +157,7 @@ sub check_api_auth_cas { $debug and warn "check_api_auth_cas"; my ($dbh, $PT, $query) = @_; my $retnumber; - my $url = $query->url(); + my $url = C4::Context->preference('OPACBaseURL') . $query->script_name(); my $casparam = $query->param('cas'); $casparam = $defaultcasserver if (not defined $casparam); -- 1.7.5.4