From 4935eb23a94b3a6a55fbb5b4321b96c8250ac15a Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Fri, 8 Jan 2016 11:39:19 -0500 Subject: [PATCH] (fix) Fixed DomainLessLogin logins in multi-domain --- SoObjects/SOGo/SOGoUserManager.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 3a1b542da..e62ef9ecf 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -802,11 +802,15 @@ static Class NSNullK; [theCurrentUser setObject: [NSNumber numberWithBool: YES] forKey: access_type]; + // For DomainLessLogin, we MUST strip any trailing domain part before + // doing lookups in our source (LDAP for example) as the UIDFieldName + // or the BindFields/MailFieldNames don't necessarily contain the + // domain in the value pair. if ([[theCurrentUser objectForKey: @"DomainLessLogin"] boolValue]) { NSRange r; - r = [theUID rangeOfString: [NSString stringWithFormat: @"@%@", theDomain]]; + r = [theUID rangeOfString: @"@"]; // We check if the range is ok here since we could be using DomainLessLogin if (r.location != NSNotFound)