mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-09-01 03:37:22 +00:00
Monotone-Parent: b60062325db9b515049a18a0ab18bb9e528b1499
Monotone-Revision: 6983b54c9f08ae3a30a944b03aba053d002a3e44 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-22T15:52:25 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,14 @@
|
||||
2008-05-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/SOGoUser.m ([SOGoUser -mailAccounts]): request
|
||||
the user login to the imap server from the LDAP user manager.
|
||||
|
||||
* SoObjects/SOGo/LDAPUserManager.m ([LDAPUserManager
|
||||
-getImapLoginForUID:uid]): new method that returns the user
|
||||
identifier to use when login to the imap server, in case it's not
|
||||
the ldap uid. This is configurable through the boolean user
|
||||
default "SOGoForceIMAPLoginWithEmail".
|
||||
|
||||
* SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject
|
||||
-sendMail]): the email passed as parameter to sendmail is now the
|
||||
bare user email.
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
- (NSString *) getCNForUID: (NSString *) uid;
|
||||
- (NSString *) getEmailForUID: (NSString *) uid;
|
||||
- (NSString *) getFullEmailForUID: (NSString *) uid;
|
||||
- (NSString *) getImapLoginForUID: (NSString *) uid;
|
||||
- (NSString *) getUIDForEmail: (NSString *) email;
|
||||
|
||||
- (BOOL) checkLogin: (NSString *) login
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
|
||||
static NSString *defaultMailDomain = nil;
|
||||
static BOOL defaultMailDomainIsConfigured = NO;
|
||||
static BOOL forceImapLoginWithEmail = YES;
|
||||
|
||||
@implementation LDAPUserManager
|
||||
|
||||
@@ -55,6 +56,8 @@ static BOOL defaultMailDomainIsConfigured = NO;
|
||||
@" value set to 'localhost'"];
|
||||
defaultMailDomain = @"localhost";
|
||||
}
|
||||
if (!forceImapLoginWithEmail)
|
||||
forceImapLoginWithEmail = [ud boolForKey: @"SOGoForceIMAPLoginWithEmail"];
|
||||
}
|
||||
|
||||
+ (BOOL) defaultMailDomainIsConfigured
|
||||
@@ -233,6 +236,11 @@ static BOOL defaultMailDomainIsConfigured = NO;
|
||||
[contactInfos objectForKey: @"c_email"]];
|
||||
}
|
||||
|
||||
- (NSString *) getImapLoginForUID: (NSString *) uid
|
||||
{
|
||||
return ((forceImapLoginWithEmail) ? [self getEmailForUID: uid] : uid);
|
||||
}
|
||||
|
||||
- (NSString *) getUIDForEmail: (NSString *) email
|
||||
{
|
||||
NSDictionary *contactInfos;
|
||||
@@ -254,13 +262,10 @@ static BOOL defaultMailDomainIsConfigured = NO;
|
||||
checkOK = NO;
|
||||
|
||||
authIDs = [[self authenticationSourceIDs] objectEnumerator];
|
||||
currentID = [authIDs nextObject];
|
||||
while (currentID && !checkOK)
|
||||
while (!checkOK && (currentID = [authIDs nextObject]))
|
||||
{
|
||||
ldapSource = [sources objectForKey: currentID];
|
||||
checkOK = [ldapSource checkLogin: login andPassword: password];
|
||||
if (!checkOK)
|
||||
currentID = [authIDs nextObject];
|
||||
}
|
||||
|
||||
return checkOK;
|
||||
|
||||
@@ -454,14 +454,15 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
|
||||
{
|
||||
NSMutableDictionary *mailAccount, *identity;
|
||||
NSMutableArray *identities;
|
||||
NSString *name, *fullName;
|
||||
NSString *name, *fullName, *imapLogin;
|
||||
NSArray *mails;
|
||||
unsigned int count, max;
|
||||
|
||||
imapLogin = [[LDAPUserManager sharedUserManager] getImapLoginForUID: login];
|
||||
mailAccount = [NSMutableDictionary dictionary];
|
||||
name = [NSString stringWithFormat: @"%@@%@",
|
||||
login, fallbackIMAP4Server];
|
||||
[mailAccount setObject: login forKey: @"userName"];
|
||||
imapLogin, fallbackIMAP4Server];
|
||||
[mailAccount setObject: imapLogin forKey: @"userName"];
|
||||
[mailAccount setObject: fallbackIMAP4Server forKey: @"serverName"];
|
||||
[mailAccount setObject: name forKey: @"name"];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user