See ChangeLog

Monotone-Parent: b60a07f4bcb416be85fafcd1299d398c09b58190
Monotone-Revision: b836806e761968a4845035ee408cce501a3f9fc5

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2011-07-19T01:21:18
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Francis Lachapelle 2011-07-19 01:21:18 +00:00
parent 49d0043a2e
commit 26126b8959
10 changed files with 68 additions and 43 deletions

View File

@ -1,3 +1,10 @@
2011-07-19 Francis Lachapelle <flachapelle@inverse.ca>
* SoObjects/SOGo/SOGoUserFolder.m (-_davFetchUsersMatching:):
append the domain to the username when SOGoEnableDomainWithUID is
set to YES. When using domains, fetch matching users from visible
domains.
2011-07-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* OpenChange/NSString+MAPIStore.m (-asUnicodeInMemCtx:): use an
@ -6,16 +13,20 @@
2011-07-18 Francis Lachapelle <flachapelle@inverse.ca>
* SoObjects/SOGo/SOGoSystemDefaults.m (-addDomainToUID): new
* SoObjects/SOGo/SOGoSystemDefaults.m (-enableDomainWithUID): new
method that returns the boolean value of the new system defaults
SOGoAddDomainToUID if at least one domain is defined.
SOGoEnableDomainWithUID if at least one domain is defined.
* SoObjects/SOGo/SOGoUser.m (-initWithLogin:roles:trust:): we now
try to extract the domain part of the login name only if the new
system defaults SOGoAddDomainToUID is set to YES.
* SoObjects/SOGo/SOGoUser.m (-initWithLogin:roles:trust:): try to
extract the domain part of the login name only if the new system
defaults SOGoEnableDomainWithUID is set to YES. If the domain is not
specified but SOGoEnableDomainWithUID is enabled, add the domain to the
login name.
* SoObjects/SOGo/SOGoUserManager.m
(-contactInfosForUserWithUIDorEmail): idem.
(-contactInfosForUserWithUIDorEmail): try to extract the domain
part of the login name only if the new system defaults
SOGoEnableDomainWithUID is set to YES..
* SoObjects/SOGo/SOGoSession.m
(+decodeValue:usingKey:login:domain:password:): idem.
@ -27,7 +38,7 @@
* UI/MainUI/SOGoUserHomePage.m (-usersSearchAction): only append
the domain to the user's login if the new system defaults
SOGoAddToDomainToUID is set to YES.
SOGoEnableDomainWithUID is set to YES.
2011-07-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>

View File

@ -29,7 +29,7 @@
SOGoWebAccessEnabled = YES;
SOGoCalendarDAVAccessEnabled = YES;
SOGoAddressBookDAVAccessEnabled = YES;
SOGoAddDomainToUID = NO;
SOGoEnableDomainWithUID = NO;
SOGoLoginModule = "Mail";
SOGoLanguage = "English";

View File

@ -254,7 +254,7 @@
*theDomain = nil;
sd = [SOGoSystemDefaults sharedSystemDefaults];
if ([sd addDomainToUID])
if ([sd enableDomainWithUID])
{
r = [*theLogin rangeOfString: @"@" options: NSBackwardsSearch];
if (r.location != NSNotFound)

View File

@ -34,7 +34,7 @@
+ (SOGoSystemDefaults *) sharedSystemDefaults;
- (NSArray *) domainIds;
- (BOOL) addDomainToUID;
- (BOOL) enableDomainWithUID;
- (NSArray *) loginDomains;
- (NSArray *) visibleDomainsForDomain: (NSString *) domain;

View File

@ -193,9 +193,9 @@ BootstrapNSUserDefaults ()
return [[self dictionaryForKey: @"domains"] allKeys];
}
- (BOOL) addDomainToUID
- (BOOL) enableDomainWithUID
{
return ([[self domainIds] count] > 0 && [self boolForKey: @"SOGoAddDomainToUID"]);
return ([[self domainIds] count] > 0 && [self boolForKey: @"SOGoEnableDomainWithUID"]);
}
- (NSArray *) loginDomains

View File

@ -125,7 +125,7 @@
/**
* Return a new instance for the login name, which can be appended by a
* domain name. The domain is extracted only if the system defaults
* SOGoAddDomainToUID is enabled.
* SOGoEnableDomainWithUID is enabled.
*
* @param newLogin a login name optionally follow by @domain
* @param newRoles
@ -139,6 +139,7 @@
{
SOGoUserManager *um;
SOGoSystemDefaults *sd;
NSDictionary *contactInfos;
NSString *realUID, *uid, *domain;
NSRange r;
@ -154,7 +155,7 @@
else
{
sd = [SOGoSystemDefaults sharedSystemDefaults];
if ([sd addDomainToUID])
if ([sd enableDomainWithUID])
{
r = [newLogin rangeOfString: @"@" options: NSBackwardsSearch];
if (r.location != NSNotFound)
@ -176,9 +177,11 @@
else
{
um = [SOGoUserManager sharedUserManager];
realUID = [[um contactInfosForUserWithUIDorEmail: newLogin
inDomain: domain]
objectForKey: @"c_uid"];
contactInfos = [um contactInfosForUserWithUIDorEmail: newLogin
inDomain: domain];
realUID = [contactInfos objectForKey: @"c_uid"];
if (domain == nil && [sd enableDomainWithUID])
domain = [contactInfos objectForKey: @"c_domain"];
}
if (domain)

View File

@ -1,6 +1,6 @@
/*
Copyright (C) 2004-2005 SKYRIX Software AG
Copyright (C) 2007-2009 Inverse inc.
Copyright (C) 2007-2011 Inverse inc.
This file is part of OpenGroupware.org.
@ -390,45 +390,56 @@
- (NSString *) _davFetchUsersMatching: (NSString *) user
{
SOGoUserManager *um;
SOGoSystemDefaults *sd;
NSMutableString *fetch;
NSEnumerator *domains;
NSDictionary *currentUser;
NSString *field, *login, *domain;
NSArray *users;
int i;
BOOL enableDomainWithUID;
#warning the attributes returned here should match the one requested in the query
fetch = [NSMutableString string];
login = [[context activeUser] login];
um = [SOGoUserManager sharedUserManager];
sd = [SOGoSystemDefaults sharedSystemDefaults];
enableDomainWithUID = [sd enableDomainWithUID];
domain = [[context activeUser] domain];
// We sort our array - this is pretty useful for the
// SOGo Integrator extension, among other things.
users = [[um fetchUsersMatching: user inDomain: domain]
sortedArrayUsingSelector: @selector (caseInsensitiveDisplayNameCompare:)];
for (i = 0; i < [users count]; i++)
domains = [[sd visibleDomainsForDomain: domain] objectEnumerator];
while (domain)
{
currentUser = [users objectAtIndex: i];
field = [currentUser objectForKey: @"c_uid"];
if (![field isEqualToString: login])
// We sort our array - this is pretty useful for the
// SOGo Integrator extension, among other things.
users = [[um fetchUsersMatching: user inDomain: domain]
sortedArrayUsingSelector: @selector (caseInsensitiveDisplayNameCompare:)];
for (i = 0; i < [users count]; i++)
{
[fetch appendFormat: @"<user><id>%@</id>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"cn"];
[fetch appendFormat: @"<displayName>%@</displayName>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"c_email"];
[fetch appendFormat: @"<email>%@</email>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"c_info"];
if ([field length])
[fetch appendFormat: @"<info>%@</info>",
[field stringByEscapingXMLString]];
[fetch appendString: @"</user>"];
currentUser = [users objectAtIndex: i];
field = [currentUser objectForKey: @"c_uid"];
if (enableDomainWithUID)
field = [NSString stringWithFormat: @"%@@%@", field, domain];
if (![field isEqualToString: login])
{
[fetch appendFormat: @"<user><id>%@</id>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"cn"];
[fetch appendFormat: @"<displayName>%@</displayName>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"c_email"];
[fetch appendFormat: @"<email>%@</email>",
[field stringByEscapingXMLString]];
field = [currentUser objectForKey: @"c_info"];
if ([field length])
[fetch appendFormat: @"<info>%@</info>",
[field stringByEscapingXMLString]];
[fetch appendString: @"</user>"];
}
}
domain = [domains nextObject];
}
return fetch;
}

View File

@ -716,7 +716,7 @@
infos = nil;
sd = [SOGoSystemDefaults sharedSystemDefaults];
if ([sd addDomainToUID])
if ([sd enableDomainWithUID])
{
r = [uid rangeOfString: @"@" options: NSBackwardsSearch];
if (r.location != NSNotFound)

View File

@ -378,7 +378,7 @@
um = [SOGoUserManager sharedUserManager];
sd = [SOGoSystemDefaults sharedSystemDefaults];
domain = [[context activeUser] domain];
uidDomain = [sd addDomainToUID]? domain : nil;
uidDomain = [sd enableDomainWithUID]? domain : nil;
users = [self _usersForResults: [um fetchUsersMatching: contact
inDomain: domain]
inDomain: uidDomain];