From 28bb1a3ed01e89588b8f95d9ad4a53c700df862a 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) Signed-off-by: Pierre Angot Signed-off-by: Paul Poulain --- C4/Auth_with_cas.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index b09623295c..e00e3a4d61 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); -- 2.39.5