Improved error message when misconfiguring the SOGoLDAPSources.

Monotone-Parent: 24fe8bbb9b61c347ef798b9f6e888d08bf6aa660
Monotone-Revision: 49bc68e8b74862055ad4e2b93e3b0c4b0e791801

Monotone-Author: ludovic@Sophos.ca
Monotone-Date: 2008-10-22T20:50:27
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Ludovic Marcotte 2008-10-22 20:50:27 +00:00
parent 2ec29054e9
commit 42e149a3b2
1 changed files with 9 additions and 4 deletions

View File

@ -111,16 +111,21 @@ static BOOL forceImapLoginWithEmail = NO;
- (void) _prepareLDAPSourcesWithDefaults: (NSUserDefaults *) ud
{
NSArray *udSources;
id udSources;
unsigned int count, max;
sources = [NSMutableDictionary new];
sourcesMetadata = [NSMutableDictionary new];
udSources = [ud arrayForKey: @"SOGoLDAPSources"];
max = [udSources count];
for (count = 0; count < max; count++)
[self _registerSource: [udSources objectAtIndex: count]];
if (udSources && [udSources isKindOfClass: [NSArray class]]) {
max = [udSources count];
for (count = 0; count < max; count++)
[self _registerSource: [udSources objectAtIndex: count]];
} else {
[self errorWithFormat: @"SOGoLDAPSources is not defined or it is not an array. Check your defaults."];
}
}
- (id) init