From 2dff5177f2d7c542175b28adf1832e201c0ae864 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 11 Apr 2013 16:46:23 +0200 Subject: [PATCH] Bug 10029 - CAS authentication fails in OPAC reserve If OPAC reserve page is accessed without being logged-in, login form is displayed as well as a CAS authentication link (if enabled). A click on this link will lead to CAS server but one comming back to Koha, page shows an error : "ERROR: No biblionumber received". This is because CAS link only contains the query path "/cgi-bin/koha/opac-reserve.pl", not the query parameters. This patch adds query parameters to URI sent to CAS. Test plan : - Enable CAS - Go to opac without been logged-in - Try to place hold on a record => You get to /cgi-bin/koha/opac-reserve.pl?biblionumber=XXX showing authentication page => Check that CAS link contains query param "biblionumber" - Click on CAS link and log in => Check you return well logged-in to reserve page with biblionumber param Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer I have followed the test plan as far as I could and the links contain the biblionumber now, which they didn't before. I couldn't check the CAS login, but my normal login worked as expected. All tests and the QA script pass. Signed-off-by: Galen Charlton (cherry picked from commit 974ab561ef00e76e7329f61b016b5d6b3103dde7) Signed-off-by: Tomas Cohen Arazi --- C4/Auth_with_cas.pm | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/C4/Auth_with_cas.pm b/C4/Auth_with_cas.pm index d8e504020e..f841449c0a 100644 --- a/C4/Auth_with_cas.pm +++ b/C4/Auth_with_cas.pm @@ -91,10 +91,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}); -- 2.39.5