@@ -, +, @@ --- C4/Auth.pm | 7 +++++-- opac/sci/sci-main.pl | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) --- a/C4/Auth.pm +++ a/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 ); } --- a/opac/sci/sci-main.pl +++ a/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 --