Bugzilla – Attachment 134199 Details for
Bug 30444
Enable Shibboleth option for SelfCheck modules for Koha
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30444: (follow-up) Ensure Self checkout by cardnumber and username/password works
Bug-30444-follow-up-Ensure-Self-checkout-by-cardnu.patch (text/plain), 5.00 KB, created by
Alex Buckley
on 2022-04-28 03:04:02 UTC
(
hide
)
Description:
Bug 30444: (follow-up) Ensure Self checkout by cardnumber and username/password works
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2022-04-28 03:04:02 UTC
Size:
5.00 KB
patch
obsolete
>From f3d2c376e45c151533cd77ea5ca1ca0723e7f205 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 22 Apr 2022 16:13:17 +1200 >Subject: [PATCH] Bug 30444: (follow-up) Ensure Self checkout by cardnumber and > username/password works > >Test plan: >1. On a Koha setup to do Shibboleth set the following sysprefs: >- OPACShibOnly = "Don't allow" >- AutoSelfCheckAllowed = Allow >- AutoSelfCheckID and AutoSelfCheckPass = The username and password of a >patron with 'self_checkout_module' sub-permission enabled >- SelfCheckoutByLogin = 'cardnumber' >2. Visit the self checkout page. Confirm a 'cardnumber' input page is >loaded >3. Enter a cardnumber and confirm the self checkout page loads >4. Change SelfCheckoutbyLogin = 'username and password' >5. Repeat step 2 and confirm a username and password input page loads. >6. Enter a username and password and confirm the self checkout page >loads >7. Change SelfCheckoutByLogin = 'shibboleth' >8. Repeat step 2 and confirm you're logged straight into the self >checkout > >Sponsored-by: Catalyst IT >--- > C4/Auth.pm | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 6 +++--- > opac/sco/sco-main.pl | 2 ++ > 3 files changed, 7 insertions(+), 5 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 6d33f08aed..e74d6f202a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1137,7 +1137,7 @@ sub checkauth { > ( > ( $type eq 'opac' ) > && C4::Context->preference('OPACShibOnly') >- && C4::Context->preference('SelfCheckoutByLogin') ne 'shibboleth' >+ && !$query->param('sco_user_login') > ) > || ( ( $type ne 'opac' ) > && C4::Context->preference('staffShibOnly') ) >@@ -1457,7 +1457,7 @@ sub checkauth { > > if ($shib) { > #If shibOnly is enabled just go ahead and redirect directly >- if ( (($type eq 'opac') && C4::Context->preference('OPACShibOnly')) || (($type ne 'opac') && C4::Context->preference('staffShibOnly')) ) { >+ if ( (($type eq 'opac') && C4::Context->preference('OPACShibOnly') && !$query->param('sco_user_login') ) || (($type ne 'opac') && C4::Context->preference('staffShibOnly')) ) { > my $redirect_url = login_shib_url( $query ); > print $query->redirect( -uri => "$redirect_url", -status => 303 ); > safe_exit; >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index b435b29501..f02b3e6beb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -233,7 +233,7 @@ > [% END %] > [% END %] > >- [% IF ( nouser ) %] >+ [% IF ( nouser && shib_only == 0 ) %] > <div class="alert alert-warning"> > <h3>Sorry</h3> > <p>The userid <strong>[% patronid | html %]</strong> was not found in the database. Please try again.</p> >@@ -404,7 +404,7 @@ > <div class="sco_entry" > > <form id="mainform" action="/cgi-bin/koha/sco/sco-main.pl" name="mainform" method="post"> > <fieldset> >- [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %] >+ [% IF ( Koha.Preference('SelfCheckoutByLogin') == 'username' ) %] > <legend>Log in to your account</legend> > <label for="patronlogin">Login:</label> > <input type="text" id="patronlogin" class="focus noEnterSubmit" size="20" name="patronlogin" autocomplete="off"/> >@@ -413,7 +413,7 @@ > <fieldset class="action"> > <button type="submit" class="btn btn-primary">Log in</button> > </fieldset> >- [% ELSE %] >+ [% ELSIF ( Koha.Preference('SelfCheckoutByLogin') == 'cardnumber' ) %] > <div class="form-row"> > <div class="col-auto"> > <label for="patronid">Please enter your card number:</label> >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index b4bede9a51..48ffc98cf6 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -383,7 +383,9 @@ if ( $patron) { > ) if $patron_image; > } > } else { >+ my $shib_only = C4::Context->preference('OPACShibOnly'); > $template->param( >+ shib_only => $shib_only, > nouser => $patronid, > ); > } >-- >2.20.1
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 30444
:
133419
|
133512
|
133513
|
133518
|
133614
|
133615
|
133616
|
134007
| 134199 |
138523