Monotone-Parent: 2fdf0ead0781ef2362dd389811d5db44ca4cc84a

Monotone-Revision: c91eef7edcfd08d414664c25a590b6268a7e58e2

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-29T04:19:32
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-11-29 04:19:32 +00:00
parent 3821d1aa7f
commit b79a7e5a00
129 changed files with 4402 additions and 3316 deletions
+35 -2
View File
@@ -68,8 +68,10 @@
@implementation SQLSource
+ (id) sourceFromUDSource: (NSDictionary *) udSource
inDomain: (NSString *) domain
{
return [[[self alloc] initFromUDSource: udSource] autorelease];
return [[[self alloc] initFromUDSource: udSource
inDomain: domain] autorelease];
}
- (id) init
@@ -96,7 +98,10 @@
}
- (id) initFromUDSource: (NSDictionary *) udSource
inDomain: (NSString *) sourceDomain
{
NSString *udDomainAttribute;
self = [self init];
ASSIGN(_sourceID, [udSource objectForKey: @"id"]);
@@ -108,7 +113,30 @@
if ([udSource objectForKey: @"viewURL"])
_viewURL = [[NSURL alloc] initWithString: [udSource objectForKey: @"viewURL"]];
#warning this domain code has no effect yet
/* FIXME: the queries below do not setup c_domain. */
udDomainAttribute = [udSource objectForKey: @"domainAttribute"];
if ([sourceDomain length])
{
if ([udDomainAttribute length])
{
[self errorWithFormat: @"cannot define 'domainAttribute'"
@" for a domain-based source (%@)", _sourceID];
[self autorelease];
return nil;
}
else
{
ASSIGN (_domain, sourceDomain);
}
}
else
{
if ([udDomainAttribute length])
ASSIGN (_domainAttribute, udDomainAttribute);
}
if (!_viewURL)
{
[self autorelease];
@@ -118,6 +146,11 @@
return self;
}
- (NSString *) domain
{
return _domain;
}
- (BOOL) _isPassword: (NSString *) plainPassword
equalTo: (NSString *) encryptedPassword
{