mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-10 02:45:08 +00:00
Monotone-Parent: f0287a95426d09a97daa0041135b4177737819c6
Monotone-Revision: 9c8fadcccf096acb0cb35206831736703fec1558 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-10T14:56:47 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
2007-05-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/LDAPSource.m ([LDAPSource
|
||||
-checkLogin:loginToCheckandPassword:passwordToCheck]): check that
|
||||
loginToCheck is not empty.
|
||||
([LDAPSource -fetchContactsMatching:match]): check that match is
|
||||
not empty.
|
||||
([LDAPSource -lookupContactEntry:entryID]): check that entryID is
|
||||
not empty.
|
||||
([LDAPSource -lookupContactEntryWithUIDorEmail:uid]): check that
|
||||
uid is not empty.
|
||||
|
||||
2007-05-09 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUser.m ([SOGoUser -primaryEmail]): new name
|
||||
|
||||
+57
-43
@@ -215,18 +215,23 @@ static NSArray *commonSearchFields;
|
||||
NSString *userDN;
|
||||
NGLdapConnection *bindConnection;
|
||||
|
||||
bindConnection = [[NGLdapConnection alloc] initWithHostName: hostname
|
||||
port: port];
|
||||
userDN = [NSString stringWithFormat: @"%@=%@,%@",
|
||||
IDField, loginToCheck, baseDN];
|
||||
NS_DURING
|
||||
didBind = [bindConnection bindWithMethod: @"simple" binddn: userDN
|
||||
credentials: passwordToCheck];
|
||||
NS_HANDLER
|
||||
didBind = NO;
|
||||
NS_ENDHANDLER
|
||||
if ([loginToCheck length] > 0)
|
||||
{
|
||||
bindConnection = [[NGLdapConnection alloc] initWithHostName: hostname
|
||||
port: port];
|
||||
userDN = [NSString stringWithFormat: @"%@=%@,%@",
|
||||
IDField, loginToCheck, baseDN];
|
||||
NS_DURING
|
||||
didBind = [bindConnection bindWithMethod: @"simple" binddn: userDN
|
||||
credentials: passwordToCheck];
|
||||
NS_HANDLER
|
||||
didBind = NO;
|
||||
NS_ENDHANDLER
|
||||
|
||||
[bindConnection release];
|
||||
[bindConnection release];
|
||||
}
|
||||
else
|
||||
didBind = NO;
|
||||
|
||||
return didBind;
|
||||
}
|
||||
@@ -237,7 +242,7 @@ static NSArray *commonSearchFields;
|
||||
NSString *qs;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
if (filter && [filter length] > 0)
|
||||
if ([filter length] > 0)
|
||||
{
|
||||
if ([filter isEqualToString: @"."])
|
||||
qs = @"(cn='*')";
|
||||
@@ -355,19 +360,22 @@ static NSArray *commonSearchFields;
|
||||
|
||||
contacts = [NSMutableArray array];
|
||||
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: [self _qualifierForFilter: match]
|
||||
attributes: [self _searchAttributes]];
|
||||
if (entries)
|
||||
if ([match length] > 0)
|
||||
{
|
||||
currentEntry = [entries nextObject];
|
||||
while (currentEntry)
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: [self _qualifierForFilter: match]
|
||||
attributes: [self _searchAttributes]];
|
||||
if (entries)
|
||||
{
|
||||
[contacts addObject:
|
||||
[self _convertLDAPEntryToContact: currentEntry]];
|
||||
currentEntry = [entries nextObject];
|
||||
while (currentEntry)
|
||||
{
|
||||
[contacts addObject:
|
||||
[self _convertLDAPEntryToContact: currentEntry]];
|
||||
currentEntry = [entries nextObject];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,16 +387,19 @@ static NSArray *commonSearchFields;
|
||||
NSDictionary *contactEntry;
|
||||
NGLdapEntry *ldapEntry;
|
||||
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
ldapEntry
|
||||
= [ldapConnection entryAtDN: [NSString stringWithFormat: @"%@=%@,%@",
|
||||
IDField, entryID, baseDN]
|
||||
attributes: [self _searchAttributes]];
|
||||
if (ldapEntry)
|
||||
contactEntry = [self _convertLDAPEntryToContact: ldapEntry];
|
||||
else
|
||||
contactEntry = nil;
|
||||
contactEntry = nil;
|
||||
|
||||
if ([entryID length] > 0)
|
||||
{
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
ldapEntry
|
||||
= [ldapConnection entryAtDN: [NSString stringWithFormat: @"%@=%@,%@",
|
||||
IDField, entryID, baseDN]
|
||||
attributes: [self _searchAttributes]];
|
||||
if (ldapEntry)
|
||||
contactEntry = [self _convertLDAPEntryToContact: ldapEntry];
|
||||
}
|
||||
|
||||
return contactEntry;
|
||||
}
|
||||
@@ -400,17 +411,20 @@ static NSArray *commonSearchFields;
|
||||
NSEnumerator *entries;
|
||||
EOQualifier *qualifier;
|
||||
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
qualifier = [self _qualifierForUIDFilter: uid];
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: [self _searchAttributes]];
|
||||
ldapEntry = [entries nextObject];
|
||||
if (ldapEntry)
|
||||
contactEntry = [self _convertLDAPEntryToContact: ldapEntry];
|
||||
else
|
||||
contactEntry = nil;
|
||||
contactEntry = nil;
|
||||
|
||||
if ([uid length] > 0)
|
||||
{
|
||||
if (!ldapConnection)
|
||||
[self _initLDAPConnection];
|
||||
qualifier = [self _qualifierForUIDFilter: uid];
|
||||
entries = [ldapConnection deepSearchAtBaseDN: baseDN
|
||||
qualifier: qualifier
|
||||
attributes: [self _searchAttributes]];
|
||||
ldapEntry = [entries nextObject];
|
||||
if (ldapEntry)
|
||||
contactEntry = [self _convertLDAPEntryToContact: ldapEntry];
|
||||
}
|
||||
|
||||
return contactEntry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user