mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-12 23:37:15 +00:00
See ChangeLog
Monotone-Parent: 86af39bf6245663b3ce86c22d61625d3204e5e62 Monotone-Revision: 707f11d374470774389d0ad41fc35614be923164 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-05-03T17:50:57 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
9cf951d32b
commit
0100fbd018
11 files changed
+219
-48
No files matched your search
@@ -441,12 +441,15 @@ static NSLock *lock = nil;
|
||||
- (NSDictionary *) contactInfosForUserWithUIDorEmail: (NSString *) uid
|
||||
{
|
||||
NSMutableDictionary *currentUser, *contactInfos;
|
||||
NSString *aUID;
|
||||
BOOL newUser;
|
||||
|
||||
if ([uid length] > 0)
|
||||
{
|
||||
// Remove the "@" prefix used to identified groups in the ACL tables.
|
||||
aUID = [uid hasPrefix: @"@"] ? [uid substringFromIndex: 1] : uid;
|
||||
contactInfos = [NSMutableDictionary dictionary];
|
||||
currentUser = [[SOGoCache sharedCache] userAttributesForLogin: uid];
|
||||
currentUser = [[SOGoCache sharedCache] userAttributesForLogin: aUID];
|
||||
#if defined(THREADSAFE)
|
||||
[lock lock];
|
||||
#endif
|
||||
@@ -461,7 +464,7 @@ static NSLock *lock = nil;
|
||||
else
|
||||
newUser = NO;
|
||||
[self _fillContactInfosForUser: currentUser
|
||||
withUIDorEmail: uid];
|
||||
withUIDorEmail: aUID];
|
||||
if (newUser)
|
||||
{
|
||||
if ([[currentUser objectForKey: @"c_uid"] length] > 0)
|
||||
@@ -574,4 +577,24 @@ static NSLock *lock = nil;
|
||||
matching: filter];
|
||||
}
|
||||
|
||||
- (NSString *) getLoginForDN: (NSString *) theDN
|
||||
{
|
||||
NSEnumerator *ldapSources;
|
||||
NSString *login;
|
||||
LDAPSource *currentSource;
|
||||
|
||||
login = nil;
|
||||
ldapSources = [[sources allValues] objectEnumerator];
|
||||
while ((currentSource = [ldapSources nextObject]))
|
||||
{
|
||||
if ([theDN hasSuffix: [currentSource baseDN]])
|
||||
{
|
||||
login = [currentSource lookupLoginByDN: theDN];
|
||||
if (login)
|
||||
break;
|
||||
}
|
||||
}
|
||||
return login;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user