]> git.koha-community.org Git - koha.git/commit
Bug 10384: fall back to normal authentication if LDAP server is not available
authorFridolyn SOMERS <fridolyn.somers@biblibre.com>
Fri, 31 May 2013 08:17:08 +0000 (10:17 +0200)
committerChris Hall <followingthepath@gmail.com>
Sun, 18 Aug 2013 04:32:41 +0000 (16:32 +1200)
commitea8708d31c4d3c6fe8dcc02b636c283f2104c4c2
treed5f433ada1e82e37fd59fff092a4d9dc2b63232e
parent9219966d46c94ff436fc91782a1f656f0716e18f
Bug 10384: fall back to normal authentication if LDAP server is not available

This fixes a bug where, assuming LDAP authentication is enabled, if a user
tries to log in while the LDAP server is down, the following fatal error
is displayed:

Can't call method "bind" on an undefined value at C4/Auth_with_ldap.pm line 134, <DATA> line 558.

This patch catches this error to allow normal authentication when LDAP connexion fails.

Test plan :
- Configure LDAP connexion with a host not having LDAP. ie :
 <useldapserver>1</useldapserver>
 <ldapserver id="ldapserver">
    <hostname>localhost</hostname>
    <base>dc=test,dc=com</base>
    <user>cn=Manager,dc=test,dc=com</user>
    <pass>passwd</pass>
    <replicate>0</replicate>
    <update>0</update>
    <auth_by_bind>0</auth_by_bind>
    <mapping>
      <firstname    is="givenname"      ></firstname>
      <surname      is="sn"             ></surname>
      <branchcode   is="branch"         >MAIN</branchcode>
      <userid       is="uid"            ></userid>
      <password     is="userpassword"   ></password>
      <email        is="mail"           ></email>
      <categorycode is="employeetype"   >PT</categorycode>
    </mapping>
 </ldapserver>
- Try to connect with mysql user (defined in koha-conf.xml)
- Try to connect with a user defined in borrowers
You may try to connect with working LDAP connexion

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 96ac578960cb4f2c5a964b3ac7fa4f9ba676b95d)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
(cherry picked from commit 85130dafc515363eba8f44973291a7af893a8b52)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
(cherry picked from commit 85130dafc515363eba8f44973291a7af893a8b52)
Signed-off-by: Chris Hall <followingthepath@gmail.com>
(cherry picked from commit e29a98f8166df4cad0cb6ea12bd06a39e52a4d47)
C4/Auth_with_ldap.pm