diff --git a/ChangeLog b/ChangeLog index 3b1ab3bf8..d055aafb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-29 Wolfgang Sourdeau + + * SoObjects/SOGo/LDAPSource.m (-initFromUDSource:inDomain): + removed handing of "domain attribute", since the underlying + mechanism causes complex code for an unrealistic case. + 2009-11-28 Wolfgang Sourdeau * SoObjects/SOGo/SOGoUserSettings.m: new class module designed to diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index bf5fc8977..9287abaaa 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -180,13 +180,13 @@ static NSArray *commonSearchFields; [modulesConstraints release]; [_scope release]; [searchAttributes release]; + [domain release]; [super dealloc]; } - (id) initFromUDSource: (NSDictionary *) udSource inDomain: (NSString *) sourceDomain { - NSString *udDomainAttribute; SOGoDomainDefaults *dd; NSNumber *udQueryLimit, *udQueryTimeout; @@ -207,28 +207,13 @@ static NSArray *commonSearchFields; IMAPHostField: [udSource objectForKey: @"IMAPHostFieldName"] andBindFields: [udSource objectForKey: @"bindFields"]]; - udDomainAttribute = [udSource objectForKey: @"domainAttribute"]; if ([sourceDomain length]) { - if ([udDomainAttribute length]) - { - [self errorWithFormat: @"cannot define 'domainAttribute'" - @" for a domain-based source (%@)", sourceID]; - [self release]; - self = nil; - } - else - { - dd = [SOGoDomainDefaults defaultsForDomain: sourceDomain]; - ASSIGN (domain, sourceDomain); - } + dd = [SOGoDomainDefaults defaultsForDomain: sourceDomain]; + ASSIGN (domain, sourceDomain); } else - { - if ([udDomainAttribute length]) - ASSIGN (domainAttribute, udDomainAttribute); - dd = [SOGoSystemDefaults sharedSystemDefaults]; - } + dd = [SOGoSystemDefaults sharedSystemDefaults]; contactInfoAttribute = [udSource objectForKey: @"SOGoLDAPContactInfoAttribute"]; @@ -541,9 +526,6 @@ static NSArray *commonSearchFields; if ([contactInfoAttribute length]) [searchAttributes addObjectUniquely: contactInfoAttribute]; - if ([domainAttribute length]) - [searchAttributes addObjectUniquely: domainAttribute]; - // Add IMAP hostname from user defaults if ([IMAPHostField length]) [searchAttributes addObjectUniquely: IMAPHostField]; @@ -732,14 +714,7 @@ static NSArray *commonSearchFields; value = @""; [contactEntry setObject: value forKey: @"c_info"]; - if (domainAttribute) - { - value = [[ldapEntry attributeWithName: domainAttribute] - stringValueAtIndex: 0]; - if (!value) - value = @""; - } - else if (domain) + if (domain) value = domain; else value = @""; diff --git a/SoObjects/SOGo/SQLSource.m b/SoObjects/SOGo/SQLSource.m index 8a9db9cb6..39c52f796 100644 --- a/SoObjects/SOGo/SQLSource.m +++ b/SoObjects/SOGo/SQLSource.m @@ -100,8 +100,6 @@ - (id) initFromUDSource: (NSDictionary *) udSource inDomain: (NSString *) sourceDomain { - NSString *udDomainAttribute; - self = [self init]; ASSIGN(_sourceID, [udSource objectForKey: @"id"]); @@ -115,27 +113,8 @@ _viewURL = [[NSURL alloc] initWithString: [udSource objectForKey: @"viewURL"]]; #warning this domain code has no effect yet - /* FIXME: the queries below do not setup c_domain. */ - udDomainAttribute = [udSource objectForKey: @"domainAttribute"]; if ([sourceDomain length]) - { - if ([udDomainAttribute length]) - { - [self errorWithFormat: @"cannot define 'domainAttribute'" - @" for a domain-based source (%@)", _sourceID]; - [self autorelease]; - return nil; - } - else - { - ASSIGN (_domain, sourceDomain); - } - } - else - { - if ([udDomainAttribute length]) - ASSIGN (_domainAttribute, udDomainAttribute); - } + ASSIGN (_domain, sourceDomain); if (!_viewURL) {