https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40628 Bug ID: 40628 Summary: Enabling StockRotation results in LDAP users not being able to log in to OPAC Change sponsored?: --- Product: Koha Version: 24.11 Hardware: PC OS: Linux Status: NEW Severity: enhancement Priority: P5 - low Component: Authentication Assignee: koha-bugs@lists.koha-community.org Reporter: schlanstedtjakob@gmail.com QA Contact: testopia@bugs.koha-community.org CC: dpavlin@rot13.org # Description After enabling the StockRotation system preference, all LDAP users fail to log in to the OPAC. This occurs consistently in my environment with the following LDAP configuration in `koha-conf.xml`: <useldapserver>1</useldapserver><!-- see C4::Auth_with_ldap for extra configs you must add if you want to turn this on --> <ldapserver id="ldapserver" listenref="ldapserver"> <hostname>ldaps://freeipa.example.org:636</hostname> <user>uid=admin,cn=users,cn=accounts,dc=example,dc=org</user> <base>cn=users,cn=accounts,dc=example,dc=org</base> <pass>********</pass> <auth_by_bind>1</auth_by_bind> <replicate>1</replicate> <update>1</update> <update_password>0</update_password> <anonymous_bind>0</anonymous_bind> <principal_name>uid=%s,cn=users,cn=accounts,dc=example,dc=org</principal_name> <mapping> <userid is="uid"></userid> <cardnumber is="uid"></cardnumber> <email is="mail"></email> <surname is="sn"></surname> <firstname is="givenname">-</firstname> <password is="userPassword"></password> <address is="address">Default Address</address> <city is="city">Default City</city> <categorycode is="1">01</categorycode> <branchcode is="1">01</branchcode> </mapping> </ldapserver> # Steps to reproduce 1. Enable LDAP authentication in `koha-conf.xml` (see config above). Confirm LDAP users can log in to OPAC. 2. Enable the StockRotation system preference in Administration → Global system preferences. 3. Attempt to log in as an LDAP user in OPAC. # Expected result LDAP users can still authenticate normally after enabling StockRotation. # Actual result LDAP users are unable to log in to OPAC. Local database accounts remain unaffected. # Additional notes - Disabling StockRotation immediately restores LDAP login functionality. - This was observed in my production environment; I have not tested on a completely fresh Koha installation due to resource limits. - No relevant changes observed in `opac-error.log` # Error log excerpts from /var/log/koha/family/plack-opac-error.log [2025/08/10 11:22:33] [WARN] Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2118. [2025/08/10 11:22:33] [WARN] Use of uninitialized value $stored_hash in substr at /usr/share/koha/lib/C4/Auth.pm line 2122. [2025/08/10 11:22:33] [WARN] Use of uninitialized value $stored_hash in string eq at /usr/share/koha/lib/C4/Auth.pm line 2127. [2025/08/10 11:53:24] [WARN] Programming error - op 'cud-login' must not start with 'cud-' for GET https://koha.jakobschlanstedt.de/opac/errors/404.pl (referer: https://koha.jakobschlanstedt.de/cgi-bin/koha/opac-main.pl) at /usr/share/koha/lib/Koha/Middleware/CSRF.pm line 97. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.