X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FAuth_with_cas.pm;h=46cb1ecd17b898675e2e641e6214aff151d1d546;hb=b0870311e1b8fae10a6ab17d0e132e911c3ab3aa;hp=e00e3a4d6194b40285854f1d8af2df795f3ec0c5;hpb=413a1e1e61b343db47b9b6fdecf3d981d87013ef;p=koha_fer diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index e00e3a4d61..46cb1ecd17 100644 --- a/C4/Auth_with_cas.pm +++ b/C4/Auth_with_cas.pm @@ -22,7 +22,6 @@ use warnings; use C4::Debug; use C4::Context; -use C4::Utils qw( :all ); use Authen::CAS::Client; use CGI; use FindBin; @@ -32,7 +31,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug); BEGIN { require Exporter; - $VERSION = 3.03; # set the version for version checking + $VERSION = 3.07.00.049; # set the version for version checking $debug = $ENV{DEBUG}; @ISA = qw(Exporter); @EXPORT = qw(check_api_auth_cas checkpw_cas login_cas logout_cas login_cas_url); @@ -91,10 +90,8 @@ sub login_cas { sub login_cas_url { my ($query, $key) = @_; - my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name(); + my $uri = C4::Context->preference('OPACBaseURL') . $query->url( -absolute => 1, -query => 1 ); my $casparam = $query->param('cas'); - # FIXME: This should be more generic and handle whatever parameters there might be - $uri .= "?cas=" . $casparam if (defined $casparam); $casparam = $defaultcasserver if (not defined $casparam); $casparam = $key if (defined $key); my $cas = Authen::CAS::Client->new($casservers->{$casparam}); @@ -145,7 +142,10 @@ sub checkpw_cas { $debug and warn "User $userid is not a valid Koha user"; } else { - $debug and warn "Invalid session ticket : $ticket"; + $debug and warn "Problem when validating ticket : $ticket"; + $debug and warn "Authen::CAS::Client::Response::Error: " . $val->error() if $val->is_error(); + $debug and warn "Authen::CAS::Client::Response::Failure: " . $val->message() if $val->is_failure(); + $debug and warn Data::Dumper::Dumper($@) if $val->is_error() or $val->is_failure(); return 0; } }