See ChangeLog

Monotone-Parent: ed15d4f340fd47347d881c8826eb40a2dc22763d
Monotone-Revision: d669b0b3e321e22c68d092f984d543560ae1af0e

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2012-01-12T20:01:34
This commit is contained in:
Francis Lachapelle committed 2012-01-12 20:01:34 +00:00
1 parent 335ba606b4
commit ccf847f555
19 files changed
+886 -36

No files matched your search

+2
View File
@@ -74,6 +74,8 @@
/* resources handling */
NSString *kindField;
NSString *multipleBookingsField;
NSString *MSExchangeHostname;
}
- (void) setBindDN: (NSString *) newBindDN
+25 -2
View File
@@ -1,6 +1,6 @@
/* LDAPSource.m - this file is part of SOGo
*
* Copyright (C) 2007-2011 Inverse inc.
* Copyright (C) 2007-2012 Inverse inc.
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Ludovic Marcotte <lmarcotte@inverse.ca>
@@ -124,6 +124,8 @@ static NSArray *commonSearchFields;
@"serialnumber",
@"calfburl",
@"proxyaddresses",
// MS Exchange
@"msExchHomeServerName",
nil];
[commonSearchFields retain];
}
@@ -181,6 +183,8 @@ static NSArray *commonSearchFields;
kindField = nil;
multipleBookingsField = nil;
MSExchangeHostname = nil;
_dnCache = [[NSMutableDictionary alloc] init];
}
@@ -216,6 +220,7 @@ static NSArray *commonSearchFields;
[_dnCache release];
[kindField release];
[multipleBookingsField release];
[MSExchangeHostname release];
[super dealloc];
}
@@ -249,7 +254,7 @@ static NSArray *commonSearchFields;
IMAPLoginField: [udSource objectForKey: @"IMAPLoginFieldName"]
bindFields: [udSource objectForKey: @"bindFields"]
kindField: [udSource objectForKey: @"KindFieldName"]
andMultipleBookingsField: [udSource objectForKey: @"MultipleBookingsFieldName"]];
andMultipleBookingsField: [udSource objectForKey: @"MultipleBookingsFieldName"]];
if ([sourceDomain length])
{
@@ -286,6 +291,8 @@ static NSArray *commonSearchFields;
if ([udSource objectForKey: @"passwordPolicy"])
passwordPolicy = [[udSource objectForKey: @"passwordPolicy"] boolValue];
ASSIGN(MSExchangeHostname, [udSource objectForKey: @"MSExchangeHostname"]);
}
return self;
@@ -297,11 +304,21 @@ static NSArray *commonSearchFields;
ASSIGN(bindDN, theDN);
}
- (NSString *) bindDN
{
return bindDN;
}
- (void) setBindPassword: (NSString *) thePassword
{
ASSIGN (password, thePassword);
}
- (NSString *) bindPassword
{
return password;
}
- (BOOL) bindAsCurrentUser
{
return _bindAsCurrentUser;
@@ -888,6 +905,7 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField
id o;
contactEntry = [NSMutableDictionary dictionary];
[contactEntry setObject: self forKey: @"source"];
[contactEntry setObject: [ldapEntry dn] forKey: @"dn"];
attributes = [[self _searchAttributes] objectEnumerator];
@@ -1225,4 +1243,9 @@ andMultipleBookingsField: (NSString *) newMultipleBookingsField
return baseDN;
}
- (NSString *) MSExchangeHostname
{
return MSExchangeHostname;
}
@end
+4 -1
View File
@@ -1,6 +1,6 @@
/* SOGoSource.h - this file is part of SOGo
*
* Copyright (C) 2009-2010 Inverse inc.
* Copyright (C) 2009-2012 Inverse inc.
*
* Author: Ludovic Marcotte <lmarcotte@inverse.ca>
*
@@ -63,13 +63,16 @@
@protocol SOGoDNSource <SOGoSource>
- (void) setBindDN: (NSString *) theDN;
- (NSString *) bindDN;
- (void) setBindPassword: (NSString *) thePassword;
- (NSString *) bindPassword;
- (BOOL) bindAsCurrentUser;
- (NSString *) lookupLoginByDN: (NSString *) theDN;
- (NSString *) lookupDNByLogin: (NSString *) theLogin;
- (NSString *) baseDN;
- (NSString *) MSExchangeHostname;
@end
+1 -1
View File
@@ -60,7 +60,7 @@
SOGoUserFolder *homeFolder;
NSString *currentPassword;
NSString *loginInDomain;
NSString *language;
//NSString *language;
NSArray *allEmails;
NSMutableArray *mailAccounts;
NSString *cn;
+1 -1
View File
@@ -234,7 +234,7 @@
[currentPassword release];
[cn release];
[loginInDomain release];
[language release];
//[language release];
[super dealloc];
}
+16 -10
View File
@@ -91,15 +91,16 @@
return sharedUserManager;
}
- (void) _registerSource: (NSDictionary *) udSource
- (BOOL) _registerSource: (NSDictionary *) udSource
inDomain: (NSString *) domain
{
NSString *sourceID, *value, *type;
NSMutableDictionary *metadata;
NSObject <SOGoSource> *sogoSource;
BOOL isAddressBook;
BOOL isAddressBook, result;
Class c;
result = NO;
sourceID = [udSource objectForKey: @"id"];
if ([sourceID length] > 0)
{
@@ -147,17 +148,20 @@
[metadata setObject: value forKey: @"SearchFieldNames"];
[_sourcesMetadata setObject: metadata forKey: sourceID];
result = YES;
}
}
else
[self errorWithFormat: @"attempted to register a contact/user source"
@" without id (skipped)"];
return result;
}
- (int) _registerSourcesInDomain: (NSString *) domain
{
NSArray *userSources;
unsigned int count, max;
unsigned int count, max, total;
SOGoDomainDefaults *dd;
if (domain)
@@ -167,11 +171,13 @@
userSources = [dd userSources];
max = [userSources count];
total = 0;
for (count = 0; count < max; count++)
[self _registerSource: [userSources objectAtIndex: count]
inDomain: domain];
if ([self _registerSource: [userSources objectAtIndex: count]
inDomain: domain])
total++;
return max;
return total;
}
- (void) _prepareSources
@@ -634,8 +640,7 @@
if ([userEntry objectForKey: @"numberOfSimultaneousBookings"])
[currentUser setObject: [userEntry objectForKey: @"numberOfSimultaneousBookings"]
forKey: @"numberOfSimultaneousBookings"];
}
}
}
if (!cn)
@@ -824,8 +829,9 @@
{
returnContact = [NSMutableDictionary dictionary];
[returnContact setObject: uid forKey: @"c_uid"];
[compactContacts setObject: returnContact forKey: uid];
}
[returnContact setObject: [userEntry objectForKey: @"source"] forKey: @"source"];
[compactContacts setObject: returnContact forKey: uid];
}
if (![[returnContact objectForKey: @"c_name"] length])
[returnContact setObject: [userEntry objectForKey: @"c_name"]
forKey: @"c_name"];