When using LDAP and leveraging the 'replicate' flag, patrons who are replicated have their cardnumber assigned equal to their LDAP username. This is an inconsistency when the 'autoMemberNum' System Preference is set to 'Do'. When 'autoMemberNum' is set to 'Don't' then replicate should act as it currently does.
Created attachment 54973 [details] [review] Assigns numerical cardnumber if autoMemberNum is enabled This patch modifies Auth_with_ldap.pm to use the autoMemberNum System Preference if it's enabled. To test: 1. Set the autoMemberNum System Preference to "Don't". 2. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 3. Check the patron record's cardnumber. 4. the cardnumber should equal the patron's LDAP username. 5. Delete the patron record. 6. Apply the patch. 7. Set the autoMemberNum System Preference to "Do". 8. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 9. Check the patron record's cardnumber. 10. The cardnumber should now be the next highest cardnumber based on autoMemberNum.
Created attachment 55048 [details] [review] Implemented autoMemberNum in C4::Auth_with_ldap.pm https://bugs.koha-community.org/show_bug.cgi?id=17215 Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
QA tools complaints: FAIL forbidden patterns forbidden pattern: tab char (line 245) forbidden pattern: tab char (line 247) forbidden pattern: tab char (line 242) forbidden pattern: tab char (line 243) forbidden pattern: tab char (line 241) forbidden pattern: tab char (line 248) forbidden pattern: tab char (line 244) forbidden pattern: tab char (line 246) Tested using LDAP server here: http://www.forumsys.com/en/tutorials/integration-how-to/ldap/online-ldap-test-server/
Just pasting in from my koha-conf.xml to ease testing setup for anyone else: <useldapserver>1</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on --> <ldapserver id="ldapserver"> <hostname>ldap://ldap.forumsys.com/</hostname> <port>389</port> <base>dc=example,dc=com</base> <user>cn=read-only-admin,dc=example,dc=com</user> <!-- DN, if not anonymous --> <pass>password</pass> <!-- password, if not anonymous --> <replicate>1</replicate> <!-- add new users from LDAP to Koha database --> <update>0</update> <!-- update existing users in Koha database --> <auth_by_bind>1</auth_by_bind> <!-- set to 1 to authenticate by binding instead of password comparison, e.g., to use Active Directory --> <principal_name>uid=%s,dc=example,dc=com</principal_name> <mapping> <!-- match koha SQL field names to your LDAP record field names --> <userid is="uid" ></userid> <categorycode is="banana">YA</categorycode> <branchcode is="apple">LPL</branchcode> <!-- <password is="userpassword" ></password>--> </mapping> </ldapserver>
Created attachment 55058 [details] [review] Bug 17215 - converted tabs to whitespace To test: 1. Set the autoMemberNum System Preference to "Don't". 2. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 3. Check the patron record's cardnumber. 4. the cardnumber should equal the patron's LDAP username. 5. Delete the patron record. 6. Apply the patch. 7. Set the autoMemberNum System Preference to "Do". 8. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 9. Check the patron record's cardnumber. 10. The cardnumber should now be the next highest cardnumber based on autoMemberNum.
Hi Lee Thanks for marking this signed off. Would you please be able to add a signoff to the patch (git commit --amend -s) And then obsolete the old ones. Thanks heaps
Sorry about that Chris! Still learning the procedures! I just signed off on it so I'll upload the signed off patch now! Thanks for the info!
Created attachment 55092 [details] [review] Bug 17215 - converted tabs to whitespace To test: 1. Set the autoMemberNum System Preference to "Don't". 2. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 3. Check the patron record's cardnumber. 4. the cardnumber should equal the patron's LDAP username. 5. Delete the patron record. 6. Apply the patch. 7. Set the autoMemberNum System Preference to "Do". 8. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 9. Check the patron record's cardnumber. 10. The cardnumber should now be the next highest cardnumber based on autoMemberNum.
I noticed that my last update didn't indicate that the patch was signed off on (still working on figuring out how to do that when I do the git commit/signoff - sorry!). So I'll add it in here manually for archival purposes. Created attachment 55092 [details] [review] Bug 17215 - converted tabs to whitespace https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=17215 Signed-off-by: Lee Jamison <ldjamison@marywood.edu>
Created attachment 55264 [details] [review] Bug 17215 - Cardnumbers of patrons created using LDAP Replication not using autoMemberNum if configured To test: 1. Set the autoMemberNum System Preference to "Don't". 2. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 3. Check the patron record's cardnumber. 4. the cardnumber should equal the patron's LDAP username. 5. Delete the patron record. 6. Apply the patch. 7. Set the autoMemberNum System Preference to "Do". 8. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 9. Check the patron record's cardnumber. 10. The cardnumber should now be the next highest cardnumber based on autoMemberNum. Signed-off-by: Lee Jamison <ldjamison@marywood.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
I have revived by 6782 yesterday and it would fix this bug. Could someone confirm?
If I may add my thoughts, 6782's scope is specific to autoMemberNum in regards to the patron creation form. However, 17215 bypasses the patron creation form altogether when Auth_with_ldap.pm triggers. Also, when reviewing the Diff of each bug's latest patch both bugs apply completely different changes. 17215 ONLY modifies C4::Auth_with_ldap while 6782 modifies C4::Members, memberentrygen.tt, and memberentry.pl
The patch from bug 6782 moves the autoMemberNum check to the AddMember subroutine. That means that the cardnumber will be auto-generated at this point.
Could someone confirm this is still needed after bug 6782?
Patch still applies, sadly, can't test LDAP with my local setup. Maybe try sending an e-mail to the list about this?
(In reply to Katrin Fischer from comment #15) > Patch still applies, sadly, can't test LDAP with my local setup. Maybe try > sending an e-mail to the list about this? Are you able to try Nick's LDAP test in Comment 4?
Should this be Signed off? I see lots of lines in the patch!
Can anyone confirm if this is still relevant?
I have reopened the bug as the problem was not fixed. It is still the case that the userId is taken as the cardnumber should a patron be created via LDAP.
The bug seems fixed with patch 29930: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=130926&action=diff When creating a new user, an empty cardnumber is now used and thus the setting 'autoMemberNum' is also considered during patron creation To test: 1. Set the autoMemberNum System Preference to "Don't". 2. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 3. Check the patron record's cardnumber. 4. the cardnumber should equal the patron's LDAP username. 5. Delete the patron record. 6. Apply the patch. 7. Set the autoMemberNum System Preference to "Do". 8. Login to the OPAC with an LDAP account that does not currently exist as a patron record. 9. Check the patron record's cardnumber. 10. The cardnumber should now be the next highest cardnumber based on autoMemberNum.