Monotone-Parent: f2f2f66b3df579ca384e578aded6976b6634ffcb

Monotone-Revision: c7009a2d8a1dce845aa1a365123f4b438e3168fe

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-01-03T22:52:27
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2012-01-03 22:52:27 +00:00
parent ad7259b751
commit 53feece892
4 changed files with 29 additions and 2 deletions

View File

@ -1,3 +1,14 @@
2012-01-03 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m (-authenticationSource): new method
that returned the SOGoSource instance that successfully recognized
the user represented by the current instance.
* SoObjects/SOGo/SOGoUserManager.m
(_fillContactInfosForUser:withUIDorEmail:inDomain:): we now set
the identifier of the source that authenticated the specified user
as the "SOGoSource" entry of the returned dictionary.
2011-12-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/LDAPSourceSchema.[hm]: new class module enabling

View File

@ -52,6 +52,8 @@
@class SOGoUserProfile;
@class SOGoUserSettings;
@protocol SOGoSource;
@interface SOGoUser : SoUser
{
SOGoUserDefaults *_defaults;
@ -88,6 +90,7 @@
/* properties */
- (NSString *) domain;
- (id <SOGoSource>) authenticationSource;
- (NSArray *) allEmails;
- (BOOL) hasEmail: (NSString *) email;

View File

@ -287,6 +287,17 @@
return [self _fetchFieldForUser: @"c_domain"];
}
- (id <SOGoSource>) authenticationSource
{
NSString *sourceID;
SOGoUserManager *um;
sourceID = [self _fetchFieldForUser: @"SOGoSource"];
um = [SOGoUserManager sharedUserManager];
return [um sourceWithID: sourceID];
}
- (NSArray *) allEmails
{
if (!allEmails)

View File

@ -573,7 +573,7 @@
NSMutableArray *emails;
NSDictionary *userEntry;
NSEnumerator *sogoSources;
NSObject <SOGoDNSource> *currentSource;
NSObject <SOGoSource> *currentSource;
NSString *sourceID, *cn, *c_domain, *c_uid, *c_imaphostname, *c_imaplogin;
NSArray *c_emails;
BOOL access;
@ -592,12 +592,14 @@
sogoSources = [[self authenticationSourceIDsInDomain: domain]
objectEnumerator];
while ((sourceID = [sogoSources nextObject]))
userEntry = nil;
while (!userEntry && (sourceID = [sogoSources nextObject]))
{
currentSource = [_sources objectForKey: sourceID];
userEntry = [currentSource lookupContactEntryWithUIDorEmail: uid];
if (userEntry)
{
[currentUser setObject: sourceID forKey: @"SOGoSource"];
if (!cn)
cn = [userEntry objectForKey: @"c_cn"];
if (!c_uid)