getUIDForEmail works on multidomain: returns login

This method is used everywhere to try to retrieve the login of the user
(and normally use the return value to [SOGoUser initwithLogin: ...])

In multidomain environments (with DomainLessLogin = false) there were
several paths (mostly in SOGoAppointmentObject.m) that were trying to
create SOGoUser objects with incorrect login: using only the uid part,
not full email. Then like domain based uid was enabled, these users
had DomainLessLogin set to true and further calls tried to authenticate
only with the uid part (and they should not).

This affects to several methods in:

  * ActiveSync/SOGoActiveSyncDispatcher.m
  * Appointments/SOGoAppointmentFolder.m
  * Appointments/SOGoAppointmentObject.m
  * Appointments/SOGoCalendarComponent.m
  * SOGoSAML2Session.m

Probably a few features related with calendars are now fixed or working
as intended in multidomain environments where the email is used as login
This commit is contained in:
Jesús García Sáez
2015-07-29 16:35:20 +02:00
parent 7496b92da5
commit 9414df26c5
+14 -3
View File
@@ -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