Bugzilla – Attachment 134801 Details for
Bug 30590
Add option for using AutoSelfCheckID and AutoSelfCheckPass values to log into OPAC self check-in module
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30590 Self-check in
Bug-30590-Self-check-in.patch (text/plain), 3.57 KB, created by
Wainui Witika-Park
on 2022-05-10 04:00:33 UTC
(
hide
)
Description:
Bug 30590 Self-check in
Filename:
MIME Type:
Creator:
Wainui Witika-Park
Created:
2022-05-10 04:00:33 UTC
Size:
3.57 KB
patch
obsolete
>From dd65f69126300e452a4f38da9987c006c8080289 Mon Sep 17 00:00:00 2001 >From: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> >Date: Tue, 10 May 2022 04:00:00 +0000 >Subject: [PATCH] Bug 30590 Self-check in > >--- > C4/Auth.pm | 14 +++++++------- > opac/sci/sci-main.pl | 15 ++++++++++++--- > 2 files changed, 19 insertions(+), 10 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 96d8feb7732..3355ee3f417 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -204,11 +204,11 @@ sub get_template_and_user { > } > > if ( $in->{type} eq 'opac' && $user ) { >- my $is_sco_user; >+ my $is_sc_user; > if ($sessionID){ > my $session = get_session($sessionID); > if ($session){ >- $is_sco_user = $session->param('sco_user'); >+ $is_sc_user = $session->param('sco_user'); > } > } > my $kick_out; >@@ -218,7 +218,7 @@ sub get_template_and_user { > # log the user out removing the CGISESSID cookie > $in->{template_name} !~ m|sco/| && $in->{template_name} !~ m|errors/errorpage.tt| > && ( >- $is_sco_user || >+ $is_sc_user || > ( > C4::Context->preference('AutoSelfCheckID') > && $user eq C4::Context->preference('AutoSelfCheckID') >@@ -1242,9 +1242,9 @@ sub checkauth { > } > } > >- my $is_sco_user = 0; >- if ( $query->param('sco_user_login') && ( $query->param('sco_user_login') eq '1' ) ){ >- $is_sco_user = 1; >+ my $is_sc_user = 0; >+ if ( $query->param('sco_user_login') && ( $query->param('sco_user_login') eq '1' ) || ($query->param('sci_user_login') && ($query->param('sci_user_login') eq '1')) ){ >+ $is_sc_user = 1; > } > > $session->param( 'number', $borrowernumber ); >@@ -1264,7 +1264,7 @@ sub checkauth { > $session->param( 'shibboleth', $shibSuccess ); > $session->param( 'register_id', $register_id ); > $session->param( 'register_name', $register_name ); >- $session->param( 'sco_user', $is_sco_user ); >+ $session->param( 'sco_user', $is_sc_user ); > } > $session->param('cas_ticket', $cas_ticket) if $cas_ticket; > C4::Context->set_userenv( >diff --git a/opac/sci/sci-main.pl b/opac/sci/sci-main.pl >index 2171fa42c51..663b99ea571 100755 >--- a/opac/sci/sci-main.pl >+++ b/opac/sci/sci-main.pl >@@ -29,15 +29,24 @@ use Try::Tiny qw( catch try ); > > my $cgi = CGI->new; > >+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']); >+ } >+ >+# Let Auth know this is a SCI context >+$cgi->param( -name => 'sci_user_login', -values => [1] ); >+ > # 404 if feature is disabled > unless ( C4::Context->preference('SelfCheckInModule') ) { > print $cgi->redirect("/cgi-bin/koha/errors/404.pl"); > exit; > } > >-# Let Auth know this is a SCI context >-$cgi->param( -name => 'sci_user_login', -values => [1] ); >- > my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > { > template_name => "sci/sci-main.tt", >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30590
:
134801
|
134909
|
134910