Bugzilla – Attachment 166025 Details for
Bug 36679
Anonymous patron is not blocked from checkout via self check
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36679: Prevent SCO login for the AnonymousPatron
Bug-36679-Prevent-SCO-login-for-the-AnonymousPatro.patch (text/plain), 1.94 KB, created by
David Nind
on 2024-05-01 21:33:14 UTC
(
hide
)
Description:
Bug 36679: Prevent SCO login for the AnonymousPatron
Filename:
MIME Type:
Creator:
David Nind
Created:
2024-05-01 21:33:14 UTC
Size:
1.94 KB
patch
obsolete
>From f7fb99a27ce2dd3831d0e6a763098c47594730a5 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Wed, 24 Apr 2024 20:00:53 +0000 >Subject: [PATCH] Bug 36679: Prevent SCO login for the AnonymousPatron > >1. Make sure AutoSelfCheckAllowed is Allowed and AutoSelfCheckID and AutoSelfCheckPass are in use. >2. Make sure AnonymousPatron is pointed to an account. >3. Set SelfCheckoutByLogin to cardnumber. >4. Verify that if you go to the anonymous patron account in the staff interface, you cannot checkout items. >5. Go to the selfcheck path of the library. It should auto login. Put in the cardnumber for the anonymous user. >6. Proceed to check out items! >7. APPLY PATCH, restart_all >8. Try step 5 again, you should not be able to log in as the AnonymousPatron. Instead you should be redirected to OPAC home page >9. Switch SelfCheckoutByLogin to 'username and pasword'. >10. Again try to log in as the AnonymousPatron, you should not be able to. >11. Make sure you can login as a regular patron when SelfCheckoutByLogin is set to 'cardnumber' and when it is set to 'username and pasword'. > >Signed-off-by: David Nind <david@davidnind.com> >--- > opac/sco/sco-main.pl | 7 +++++++ > 1 file changed, 7 insertions(+) > >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index a7fcb24d8f..6262af7b50 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -123,11 +123,18 @@ unless ( $patronid ) { > } > > my $patron; >+my $anonymous_patron = C4::Context->preference('AnonymousPatron'); > if ( $patronid ) { > Koha::Plugins->call( 'patron_barcode_transform', \$patronid ); > $patron = Koha::Patrons->find( { cardnumber => $patronid } ); >+ # redirect to OPAC home if user is trying to log in as the anonymous patron >+ if ( $patron && ( $patron->borrowernumber eq $anonymous_patron ) ) { >+ print $query->redirect("/cgi-bin/koha/opac-main.pl"); >+ exit; >+ } > } > >+ > undef $jwt unless $patron; > > my $branch = $issuer->{branchcode}; >-- >2.39.2
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 36679
:
165487
|
166025
|
167392