Bug 28385: ldap server configuration broken since migration from XML::Simple
authorDobrica Pavlinusic <dpavlin@rot13.org>
Wed, 19 May 2021 10:24:53 +0000 (12:24 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 25 May 2021 07:45:22 +0000 (09:45 +0200)
commit1c9f8defcb69991bf7f0ee70f8787228505e8537
tree3534a4d56343882645007bb1cdc06b6810f6936a
parent07e760bff827dae0d905a9f3af6368a8b5982a98
Bug 28385: ldap server configuration broken since migration from XML::Simple

Bug 28278 removed usage of XML::Simple which had side-affect that
C4::Context->config("ldapserver") returns one more level of hash
based on id of element, so ldap configuration was no longer
available generating error in log:

No ldapserver "hostname" defined in KOHA_CONF: /etc/koha/sites/srvgit/koha-conf.xml

which is very confusing since hostname is there, but we are looking
at wrong place for it.

== Test plan ==
1. Setup an LDAP server with users or use a public one
     See https://wiki.koha-community.org/wiki/Ldap_testing
2. Configure Koha to use it, see example config above
3. Go to OPAC
4. Koha doesn't compile due to LDAP config not parsed correctly
5. Apply the patch
6. Koha compiles and page loads
7. Log in successfully with one of the LDAP users
8. Bonus: Try to log-in with a wrong username & a good password and
     vice-versa

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/Auth_with_ldap.pm