From d1b6e91ecf7d00c0bc07314f4798ebbd549ec40b Mon Sep 17 00:00:00 2001 From: Wainui Witika-Park Date: Thu, 12 May 2022 13:13:23 +1200 Subject: [PATCH] Bug 30590 fixing sci sso --- C4/Auth.pm | 7 +++++-- opac/sci/sci-main.pl | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 3355ee3f417..eb53f1d64b1 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -177,6 +177,7 @@ sub get_template_and_user { if ( $in->{'template_name'} !~ m/maintenance/ ) { ( $user, $cookie, $sessionID, $flags ) = checkauth( + $in->{'query'}, $in->{'authnotrequired'}, $in->{'flagsrequired'}, @@ -216,7 +217,7 @@ sub get_template_and_user { if ( # If the user logged in is the SCO user and they try to go out of the SCO module, # log the user out removing the CGISESSID cookie - $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt| + $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|sci/| && $in->{template_name} !~ m|errors/errorpage.tt| && ( $is_sc_user || ( @@ -1140,6 +1141,8 @@ sub checkauth { ( ( $type eq 'opac' ) && C4::Context->preference('OPACShibOnly') + && !$query->param('sco_user_login') + && !$query->param('sci_user_login') ) || ( ( $type ne 'opac' ) && C4::Context->preference('staffShibOnly') ) @@ -1247,6 +1250,7 @@ sub checkauth { $is_sc_user = 1; } + $session->param( 'number', $borrowernumber ); $session->param( 'id', $userid ); $session->param( 'cardnumber', $cardnumber ); @@ -1346,7 +1350,6 @@ sub checkauth { print $query->redirect(-uri => $uri->as_string, -cookie => $cookie, -status=>'303 See other'); exit; } - return ( $userid, $cookie, $sessionID, $flags ); } diff --git a/opac/sci/sci-main.pl b/opac/sci/sci-main.pl index 663b99ea571..5ee13941eb2 100755 --- a/opac/sci/sci-main.pl +++ b/opac/sci/sci-main.pl @@ -33,9 +33,9 @@ if (C4::Context->preference('AutoSelfCheckAllowed')) { my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID'); my $AutoSelfCheckPass = C4::Context->preference('AutoSelfCheckPass'); - $query->param(-name=>'userid',-values=>[$AutoSelfCheckID]); - $query->param(-name=>'password',-values=>[$AutoSelfCheckPass]); - $query->param(-name=>'koha_login_context',-values=>['sco']); + $cgi->param(-name=>'userid',-values=>[$AutoSelfCheckID]); + $cgi->param(-name=>'password',-values=>[$AutoSelfCheckPass]); + $cgi->param(-name=>'koha_login_context',-values=>['sco']); } # Let Auth know this is a SCI context -- 2.11.0