Fix mail delegation of pristine user accounts

Fixes #4160
This commit is contained in:
Francis Lachapelle
2017-05-08 11:23:32 -04:00
parent 9700b93ad1
commit 0185ba9d46
3 changed files with 19 additions and 4 deletions
+1
View File
@@ -15,6 +15,7 @@ Bug fixes
- [web] prevented form to be marked dirty when changing password (#4138)
- [web] restored support for SOGoLDAPContactInfoAttribute
- [web] avoid duplicated email addresses in LDAP-based addressbook (#4129)
- [web] fixed mail delegation of pristine user accounts (#4160)
- [core] cherry-picked comma escaping fix from v2 (#3296)
- [core] fix sogo-tool restore potentially crashing on corrupted data (#4048)
- [core] handle properly mails using windows-1255 charset (#4124)
+9 -2
View File
@@ -1092,13 +1092,20 @@ static NSString *inboxFolderName = @"INBOX";
- (void) _setDelegates: (NSArray *) newDelegates
{
NSMutableDictionary *mailSettings;
SOGoUser *ownerUser;
SOGoUserSettings *settings;
ownerUser = [SOGoUser userWithLogin: [self ownerInContext: context]];
settings = [ownerUser userSettings];
[[settings objectForKey: @"Mail"] setObject: newDelegates
forKey: @"DelegateTo"];
mailSettings = [settings objectForKey: @"Mail"];
if (!mailSettings)
{
mailSettings = [NSMutableDictionary dictionaryWithCapacity: 1];
[settings setObject: mailSettings forKey: @"Mail"];
}
[mailSettings setObject: newDelegates
forKey: @"DelegateTo"];
[settings synchronize];
}
+9 -2
View File
@@ -45,11 +45,18 @@
- (void) _setMailDelegators: (NSArray *) newDelegators
{
NSMutableDictionary *mailSettings;
SOGoUserSettings *settings;
settings = [self userSettings];
[[settings objectForKey: @"Mail"] setObject: newDelegators
forKey: @"DelegateFrom"];
mailSettings = [settings objectForKey: @"Mail"];
if (!mailSettings)
{
mailSettings = [NSMutableDictionary dictionaryWithCapacity: 1];
[settings setObject: mailSettings forKey: @"Mail"];
}
[mailSettings setObject: newDelegators
forKey: @"DelegateFrom"];
[settings synchronize];
}