Bugzilla – Attachment 167392 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.96 KB, created by
Martin Renvoize (ashimema)
on 2024-06-04 12:15:29 UTC
(
hide
)
Description:
Bug 36679: Prevent SCO login for the AnonymousPatron
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-06-04 12:15:29 UTC
Size:
1.96 KB
patch
obsolete
>From 80c82803d6227aa64c8ae053f2fa6c378cd38034 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> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.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 d4f22aa0f7b..bf923c754f9 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -129,9 +129,16 @@ 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; >-- >2.45.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 36679
:
165487
|
166025
| 167392