From a2c469d46a151917d9f19280e3f390f74c5270c6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 8 Apr 2015 14:19:31 -0400 Subject: [PATCH] (fix) correctly handle PreventInvitationsWhitelist --- UI/PreferencesUI/UIxJSONPreferences.m | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index f33797ca2..610a712f1 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -25,6 +25,7 @@ #import #import +#import #import #import #import @@ -136,9 +137,21 @@ - (WOResponse *) jsonSettingsAction { SOGoUserSettings *settings; + id v; settings = [[context activeUser] userSettings]; + // We sanitize PreventInvitationsWhitelist if we need to, this is due to the fact + // that SOGo <= 2.2.17 used to store it as a JSON *string* within the JSON-blob - + // sorry about this engineering brain fart! + v = [[settings objectForKey: @"Calendar"] objectForKey: @"PreventInvitationsWhitelist"]; + + if (v && [v isKindOfClass: [NSString class]]) + { + [[settings objectForKey: @"Calendar"] setObject: [v objectFromJSONString] + forKey: @"PreventInvitationsWhitelist"]; + } + return [self _makeResponse: [[settings source] values]]; }