Koha-clms/C4
Kyle M Hall cd809940b7 Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron
Imagine we have a set of users. Some of those users have a NULL userid. We then call AuthenticatePatron from ILS-DI for a patron with a NULL userid, but a valid cardnumber. We call checkpw, which returns the cardnumber and userid. We then call Koha::Patrons->find on the userid *which is null*, meaning the borrowernumber returned is not the correct one, but instead the earliest patron inserted into the database that has a NULL userid.

Test Plan:
1) Give three patrons a userid and a password
2) From the database cli, set all patrons's userid to null
   Run this query: update borrowers set userid = null;
3) Call AuthenticatePatron with username being the 1st patron cardnumber,
   and password being the password you set for that patron
   http://localhost:8080/cgi-bin/koha/ilsdi.pl?service=AuthenticatePatron&username=kohacard&password=koha
4) Note you get back a borrowernumber for a different patron. Refresh the page and the number is correct.
5) Do the same with the 2nd patron. Same issue at 1st and correct number after.
6) Apply this patch
7) Restart all the things!
8) Do the same with the 3rd patron.
9) Note you get the correct borrowernumber! :D
10) prove t/Auth.t t/db_dependent/Auth_with_ldap.t t/Auth_with_shibboleth.t t/db_dependent/Auth_with_cas.t

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
2024-01-24 08:30:00 +00:00
..
AuthoritiesMarc Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Barcodes Bug 26328: Cast barcode from varchar to integer for incremental barcode 2022-03-23 10:50:51 -10:00
ClassSortRoutine Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ClassSplitRoutine Bug 28572: Remove C4::Debug 2021-06-22 12:04:32 +02:00
Creators Bug 24001: Fix Card template/rpinter profile creation and edit 2022-04-28 10:49:20 -10:00
External Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Form Bug 28572: Remove C4::Debug 2021-06-22 12:04:32 +02:00
Heading Bug 33100: Remove all punctuation at end of record 2023-04-21 16:53:01 +00:00
ILSDI Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-01-24 08:30:00 +00:00
Installer Bug 30731: Remove Readonly::XS::MAGIC_COOKIE 2022-06-10 15:18:51 +00:00
Labels Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Linker Bug 28676: Cache and retrieve match_count when searching a cached heading 2021-09-20 12:06:56 +02:00
Members Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
OAI Bug 30308: Fix bulkmarcimport.pl broken by OAI-PMH:AutoUpdateSets(EmbedItemData) 2022-09-02 17:02:24 +00:00
Output Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Patroncards Bug 31259: Escape infinite loop when lime cannot wrap enough 2023-04-24 17:31:02 +00:00
Reports Bug 31276: Report results are limited to 999,999 no matter the actual number of results 2022-09-30 23:02:24 +00:00
SIP Bug 33216: Catch and handle RegisterRequired exceptions for SIP fee paid messages 2023-05-15 14:39:12 +00:00
Search Bug 29915: Tiny session adjustments 2022-03-22 10:17:33 -10:00
Serials Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Utils Bug 29648: (QA follow-up) Minor POD fix 2022-04-27 11:20:45 -10:00
Accounts.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Acquisition.pm Bug 31649: Fix acquisition basket group CSV export if biblio does not exist 2022-12-05 17:58:34 +00:00
Auth.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-01-24 08:30:00 +00:00
Auth_cas_servers.yaml.sample
…
Auth_with_cas.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-01-24 08:30:00 +00:00
Auth_with_ldap.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-01-24 08:30:00 +00:00
Auth_with_shibboleth.pm Bug 34893: ILS-DI can return the wrong patron for AuthenticatePatron 2024-01-24 08:30:00 +00:00
AuthoritiesMarc.pm Bug 32279: Add GetAuthorizedHeading method export C4::AuthoritiesMarc 2023-04-24 17:38:33 +00:00
BackgroundJob.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Barcodes.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Biblio.pm Bug 34182: Don't set biblio.serial based on biblio.seriestitle in AddBiblio 2023-09-13 20:37:07 +00:00
Breeding.pm Bug 33404: Fix serverhost and init $page 2023-11-07 14:24:26 +00:00
Budgets.pm Bug 27550: "Duplicate budget" does not keep users associated with that budget 2022-10-31 22:52:04 +00:00
Calendar.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Charset.pm Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
Circulation.pm Bug 18398: Update C4::Message enqueue to use $patron->notice_email_address 2023-05-15 14:33:33 +00:00
ClassSortRoutine.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-08-12 16:52:14 +00:00
ClassSource.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-08-12 16:52:14 +00:00
ClassSplitRoutine.pm Bug 29951: Fix EXPORT for C4::ClassS*Routine modules 2022-08-12 16:52:14 +00:00
Context.pm Bug 28327: (follow-up) Comma as default CSV delimiter 2022-10-14 19:30:08 +00:00
Contract.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
CourseReserves.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Creators.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
HTML5Media.pm Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
Heading.pm Bug 25616: Uppercase hard coded lower case boolean operators for Elasticsearch 2022-02-24 14:35:36 -10:00
HoldsQueue.pm Bug 32247: Exit holds queue builder if there are no holds on the biblio 2023-01-19 23:16:00 +00:00
ImportBatch.pm Bug 32990: Prevent deadlock in _update_batch_record_counts 2023-06-13 16:18:55 +00:00
ImportExportFramework.pm Bug 13952: (follow-up) JS translatability, clean warns, other 2022-04-04 16:23:46 +02:00
InstallAuth.pm Bug 26019: Koha should set SameSite attribute on cookies 2022-04-13 15:55:38 +02:00
Installer.pm Bug 33341: Address some perlcritic errors in 5.36 2023-04-24 17:16:12 +00:00
ItemCirculationAlertPreference.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Items.pm Bug 32456: Preserve date accessioned if a date is not explicitly passed 2023-01-19 23:54:03 +00:00
Koha.pm Bug 33341: Address some perlcritic errors in 5.36 2023-04-24 17:16:12 +00:00
Labels.pm
…
Languages.pm Bug 33341: Address some perlcritic errors in 5.36 2023-04-24 17:16:12 +00:00
Letters.pm Bug 27265: (follow-up) Use existing parameter 2022-12-21 20:58:04 +00:00
Linker.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Log.pm Bug 30984: (QA follow-up) Ternary formatting style 2022-09-29 15:26:00 +00:00
MarcModificationTemplates.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Matcher.pm Bug 26611: Make authority record matching use required match checks 2023-11-07 14:27:46 +00:00
Members.pm Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
Message.pm Bug 18398: (follow-up) Update POD & Unit tests 2023-05-15 14:33:33 +00:00
Output.pm Bug 30524: Core CSRF checking code 2023-08-03 16:40:00 -03:00
Overdues.pm Bug 34279: Don't enforce overduefinescap unless it is greater than 0 2023-09-13 20:58:19 +00:00
Patroncards.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Record.pm Bug 18984: Remove NORMARC support 2021-10-07 15:36:40 +02:00
Reports.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Reserves.pm Revert "Bug 33210: (Bug 31963 follow-up) No hold fee message on OPAC should be displayed when there is no fee" 2023-05-15 21:36:47 +00:00
Ris.pm Bug 33341: Address some perlcritic errors in 5.36 2023-04-24 17:16:12 +00:00
RotatingCollections.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SMS.pm Bug 27673: Replace YAML with YAML::XS 2021-02-16 14:54:50 +01:00
Scheduler.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Scrubber.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Search.pm Bug 13976: Sort popularity numerically in Zebra 2023-04-24 17:28:30 +00:00
Serials.pm Bug 33040: Add "Date published (text)" to serials tab on record view (detail.pl) 2023-05-05 21:40:06 +00:00
Service.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
ShelfBrowser.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
SocialData.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Stats.pm Bug 19532: Recalls objects and tests 2022-03-14 22:45:51 -10:00
Suggestions.pm Bug 28855: Purging suggestions test should not be on timestamp 2021-12-15 12:14:47 -10:00
TTParser.pm
…
Tags.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
Templates.pm Bug 31390: Remove noisy warns in C4::Templates 2022-10-14 21:58:29 +00:00
TmplToken.pm
…
TmplTokenType.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
UsageStats.pm Bug 30237: Replace AutoEmailOpacUser with AutoEmailNewUser 2022-04-20 09:03:39 -10:00
XISBN.pm Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
XSLT.pm Bug 30291: Changes to controller scripts 2022-05-05 11:17:36 -10:00