Improve validation of mail account delegators
parent
65a653ac0c
commit
b44bf86164
1
NEWS
1
NEWS
|
@ -16,6 +16,7 @@ Bug fixes
|
|||
- [web] only show the organizer field of an IMIP REPLY if one is defined
|
||||
- [web] fixed saving the note of a card (#3849)
|
||||
- [web] fixed support for recurrent tasks
|
||||
- [web] improved validation of mail account delegators
|
||||
- [eas] improve handling of email folders without a parent
|
||||
- [eas] never send IMIP reply when the "initiator" is Outlook 2013/2016
|
||||
- [core] only consider SMTP addresses for AD's proxyAddresses (#3842)
|
||||
|
|
|
@ -1134,12 +1134,10 @@ static NSString *inboxFolderName = @"INBOX";
|
|||
{
|
||||
currentDelegate = [oldDelegates objectAtIndex: count];
|
||||
delegateUser = [SOGoUser userWithLogin: currentDelegate];
|
||||
if (delegateUser)
|
||||
{
|
||||
[delegates removeObject: currentDelegate];
|
||||
if (delegateUser)
|
||||
[delegateUser removeMailDelegator: owner];
|
||||
}
|
||||
}
|
||||
|
||||
[self _setDelegates: delegates];
|
||||
}
|
||||
|
|
|
@ -634,8 +634,9 @@
|
|||
NSUInteger index;
|
||||
|
||||
[self userDefaults];
|
||||
[self userSettings];
|
||||
|
||||
mailSettings = [[self userSettings] objectForKey: @"Mail"];
|
||||
mailSettings = [_settings objectForKey: @"Mail"];
|
||||
mailAccount = [NSMutableDictionary new];
|
||||
|
||||
// 1. login
|
||||
|
@ -800,18 +801,43 @@
|
|||
delegators = [mailSettings objectForKey: @"DelegateFrom"];
|
||||
if (delegators)
|
||||
{
|
||||
NSDictionary *delegatorAccount;
|
||||
SOGoUser *delegator;
|
||||
BOOL dirty;
|
||||
NSDictionary *delegatorAccount, *delegatorSettings;
|
||||
NSMutableArray *validDelegators;
|
||||
NSString *delegatorLogin;
|
||||
SOGoUser *delegatorUser;
|
||||
|
||||
dirty = NO;
|
||||
validDelegators = [NSMutableArray array];
|
||||
max = [delegators count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
delegator = [SOGoUser userWithLogin: [delegators objectAtIndex: count]];
|
||||
if (delegator)
|
||||
// 1. Verify if delegator is valid
|
||||
delegatorLogin = [delegators objectAtIndex: count];
|
||||
delegatorUser = [SOGoUser userWithLogin: delegatorLogin];
|
||||
if (delegatorUser)
|
||||
{
|
||||
delegatorAccount = [[delegator mailAccountsWithDelegatedIdentities: NO] objectAtIndex: 0];
|
||||
// 2. Verify if delegator still delegates to user
|
||||
delegatorSettings = [[delegatorUser userSettings] objectForKey: @"Mail"];
|
||||
delegates = [delegatorSettings objectForKey: @"DelegateTo"];
|
||||
if ([delegates containsObject: [self login]])
|
||||
{
|
||||
[validDelegators addObject: delegatorLogin];
|
||||
delegatorAccount = [[delegatorUser mailAccountsWithDelegatedIdentities: NO] objectAtIndex: 0];
|
||||
[identities addObjectsFromArray: [delegatorAccount objectForKey: @"identities"]];
|
||||
}
|
||||
else
|
||||
dirty = YES;
|
||||
}
|
||||
else
|
||||
dirty = YES;
|
||||
}
|
||||
|
||||
if (dirty)
|
||||
{
|
||||
[mailSettings setObject: validDelegators
|
||||
forKey: @"DelegateFrom"];
|
||||
[_settings synchronize];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue