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 <tredok.pierre@gmail.com>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
This commit is contained in:
Julian Maurice 2011-07-19 12:14:00 +02:00 committed by Paul Poulain
parent ae9ab2c90b
commit 28bb1a3ed0

View file

@ -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);