mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-15 05:14:53 +00:00
Improve validation of mail account delegators
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
Bug fixes
|
||||
- [web] fixed support for recurrent tasks
|
||||
- [web] improved validation of mail account delegators
|
||||
|
||||
2.3.17 (2016-10-20)
|
||||
-------------------
|
||||
@@ -37,7 +38,7 @@ Bug fixes
|
||||
- [core] make sure new cards always have a UID (#3819)
|
||||
|
||||
2.3.15 (2016-09-14)
|
||||
------------------
|
||||
-------------------
|
||||
|
||||
Enhancements
|
||||
- [web] don't allow a recurrence rule to end before the first occurrence
|
||||
|
||||
@@ -32,15 +32,45 @@
|
||||
|
||||
- (NSArray *) mailDelegators
|
||||
{
|
||||
NSDictionary *mailSettings;
|
||||
NSArray *mailDelegators;
|
||||
BOOL dirty;
|
||||
NSDictionary *mailSettings, *delegatorSettings;
|
||||
NSArray *mailDelegators, *delegates;
|
||||
NSMutableArray *validMailDelegators;
|
||||
NSString *delegatorLogin;
|
||||
SOGoUser *delegatorUser;
|
||||
unsigned int max, count;
|
||||
|
||||
dirty = NO;
|
||||
validMailDelegators = [NSMutableArray array];
|
||||
mailSettings = [[self userSettings] objectForKey: @"Mail"];
|
||||
mailDelegators = [mailSettings objectForKey: @"DelegateFrom"];
|
||||
if (!mailDelegators)
|
||||
mailDelegators = [NSArray array];
|
||||
if (mailDelegators)
|
||||
{
|
||||
max = [mailDelegators count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
// 1. Verify if delegator is valid
|
||||
delegatorLogin = [mailDelegators objectAtIndex: count];
|
||||
delegatorUser = [SOGoUser userWithLogin: delegatorLogin];
|
||||
if (delegatorUser)
|
||||
{
|
||||
// 2. Verify if delegator still delegates to user
|
||||
delegatorSettings = [[delegatorUser userSettings] objectForKey: @"Mail"];
|
||||
delegates = [delegatorSettings objectForKey: @"DelegateTo"];
|
||||
if ([delegates containsObject: [self login]])
|
||||
[validMailDelegators addObject: delegatorLogin];
|
||||
else
|
||||
dirty = YES;
|
||||
}
|
||||
else
|
||||
dirty = YES;
|
||||
}
|
||||
}
|
||||
|
||||
return mailDelegators;
|
||||
if (dirty)
|
||||
[self _setMailDelegators: validMailDelegators];
|
||||
|
||||
return validMailDelegators;
|
||||
}
|
||||
|
||||
- (void) _setMailDelegators: (NSArray *) newDelegators
|
||||
|
||||
Reference in New Issue
Block a user