From 1c3f1af662910834c8c1e0af366f7e9260cb3e7b Mon Sep 17 00:00:00 2001 From: Skruppy Date: Sat, 15 Mar 2014 15:10:26 +0100 Subject: [PATCH] ModulesConstraints tests all values of a multi-valued attributes --- SoObjects/SOGo/LDAPSource.m | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/SoObjects/SOGo/LDAPSource.m b/SoObjects/SOGo/LDAPSource.m index 0495ee671..daeddb740 100644 --- a/SoObjects/SOGo/LDAPSource.m +++ b/SoObjects/SOGo/LDAPSource.m @@ -887,7 +887,7 @@ static Class NSStringK; intoLDIFRecord: (NSMutableDictionary *) ldifRecord { NSDictionary *constraints; - NSEnumerator *matches; + NSEnumerator *matches, *ldapValues; NSString *currentMatch, *currentValue, *ldapValue; BOOL result; @@ -897,16 +897,15 @@ static Class NSStringK; if (constraints) { matches = [[constraints allKeys] objectEnumerator]; - currentMatch = [matches nextObject]; - while (result && currentMatch) + while (result == YES && (currentMatch = [matches nextObject])) { - ldapValue = [[ldapEntry attributeWithName: currentMatch] - stringValueAtIndex: 0]; + ldapValues = [[[ldapEntry attributeWithName: currentMatch] allStringValues] objectEnumerator]; currentValue = [constraints objectForKey: currentMatch]; - if ([ldapValue caseInsensitiveMatches: currentValue]) - currentMatch = [matches nextObject]; - else - result = NO; + result = NO; + + while (result == NO && (ldapValue = [ldapValues nextObject])) + if ([ldapValue caseInsensitiveMatches: currentValue]) + result = YES; } }