diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 127c6756c..af21f8635 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -394,11 +394,22 @@ static Class NSNullK; - (NSString *) getUIDForEmail: (NSString *) email { - NSDictionary *contactInfos; + NSDictionary *info; + SOGoSystemDefaults *sd; + NSString *uid, *domain; - contactInfos = [self contactInfosForUserWithUIDorEmail: email]; + info = [self contactInfosForUserWithUIDorEmail: email]; + uid = [info objectForKey: @"c_uid"]; - return [contactInfos objectForKey: @"c_uid"]; + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([sd enableDomainBasedUID] + && ![[info objectForKey: @"DomainLessLogin"] boolValue]) + { + domain = [info objectForKey: @"c_domain"]; + uid = [NSString stringWithFormat: @"%@@%@", uid, domain]; + } + + return uid; } - (BOOL) _sourceChangePasswordForLogin: (NSString *) login