From f57ff869513496c95624ad0c2385c08b58b01b00 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 23 May 2019 15:02:10 -0400 Subject: [PATCH] (fix) fixed domain placeholder issue when using sogo-tool (fixes #4723) --- NEWS | 1 + SoObjects/SOGo/LDAPSource.h | 2 ++ SoObjects/SOGo/SOGoUserManager.m | 6 +++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 5d1035c75..fb2f0bc39 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ Bug fixes - [core] consider DAVx5 like Apple Calendar (#4304) - [core] improve handling of signer certificate (#4742) - [core] added safety checks in S/MIME (#4745) + - [core] fixed domain placeholder issue when using sogo-tool (#4723) 4.0.7 (2019-02-27) ------------------ diff --git a/SoObjects/SOGo/LDAPSource.h b/SoObjects/SOGo/LDAPSource.h index 07df40295..f8fac5d97 100644 --- a/SoObjects/SOGo/LDAPSource.h +++ b/SoObjects/SOGo/LDAPSource.h @@ -123,6 +123,8 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField; - (void) applyContactMappingToResult: (NSMutableDictionary *) ldifRecord; +- (void) updateBaseDNFromLogin: (NSString *) theLogin; + @end #endif /* LDAPSOURCE_H */ diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index ab280141e..85b942119 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -837,6 +837,10 @@ static Class NSNullK; { currentSource = [_sources objectForKey: sourceID]; + // We update the placeholder in the LDAP source if needed + if ([currentSource conformsToProtocol: @protocol(SOGoDNSource)]) + [currentSource updateBaseDNFromLogin: theUID]; + // Use the provided domain during the lookup. If none is defined, use the source's one // so if there's a match based on the source's domain, the user ID will be associated // to the right source. @@ -1078,7 +1082,7 @@ static Class NSNullK; [self _retainUser: currentUser withLogin: cacheUid]; } - } + } // if (newUser) } } else