From 826537ed018053dcbe0012afc60750bb0b68b9f0 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Wed, 5 Feb 2014 09:04:00 -0500 Subject: [PATCH] Fix caching of DN in LDAP source --- SoObjects/SOGo/LDAPSource.m | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index cb664a6b9..0495ee671 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -549,10 +549,6 @@ static Class NSStringK; if (userDN) { - // We cache the _login <-> userDN entry to speed up things - [[SOGoCache sharedCache] setDistinguishedName: userDN - forLogin: _login]; - if (!passwordPolicy) didBind = [bindConnection bindWithMethod: @"simple" binddn: userDN @@ -564,6 +560,11 @@ static Class NSStringK; perr: (void *)_perr expire: _expire grace: _grace]; + + if (didBind) + // We cache the _login <-> userDN entry to speed up things + [[SOGoCache sharedCache] setDistinguishedName: userDN + forLogin: _login]; } } }