Bug 29930: Cardnumber incorrectly set to userid on LDAP auth if cardnumber not mapped
authorJanik Hilser <janik.hilser@icloud.com>
Sun, 20 Feb 2022 17:14:31 +0000 (18:14 +0100)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 8 Feb 2024 18:54:06 +0000 (18:54 +0000)
commitff3b281df9837a93d55ddc2e2e120826f69a07dc
treee1ba7041344a907f57c7672fdc4c383dc6db0980
parentfc2646a317886afc7d6df0e3e409a585f952bc2c
Bug 29930: Cardnumber incorrectly set to userid on LDAP auth if cardnumber not mapped

In the sub the userId was given, but the cardnumber was expected, therefore at every login the cardnumber changed to the userId.

To test:
1. Login to the OPAC with an LDAP account that has a cardnumber which is different to the userId
2. Check the patron record's cardnumber.
3. The cardnumber should equal to the userId
4. Apply the patch.
5. Login to the OPAC with an LDAP account that has a cardnumber which is different to the userId
6. Check the patron record's cardnumber.
7. The cardnumber should be the same as before

Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Extra test plan:
1. Apply the regression tests
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Auth_with_ldap.t
=> FAIL: Tests fail! 'cardnumber' incorrectly overwritten
3. Apply this patch
4. Repeat 2
=> SUCCESS: Tests now pass!
5. Sign off :-D

Signed-off-by: Alexander Wagner <alexander.wagner@desy.de>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 6341d520ac0a09baa5b005abb3d8d81273a6e310)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
(cherry picked from commit 884e3d5fe026c254ed1d2467f536e385ec2e7bf4)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/Auth_with_ldap.pm