diff --git a/ChangeLog b/ChangeLog index b5213feb1..c9e64c10b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-06-22 Wolfgang Sourdeau + * UI/PreferencesUI/UIxJSONPreferences.m ([UIxJSONPreferences + -jsonDefaultsAction]): bug fix: returns a WOResponse instance with + the string instead of the string itself. + ([UIxJSONPreferences -jsonSettingsAction]): same as above. + * SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): new module bool var "acceptAnyUser" that is set when the AuthenticationMethod user default is nil. diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index 96f1d35f9..0b18a97b8 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -24,20 +24,34 @@ #import #import +#import +#import #import #import "UIxJSONPreferences.h" @implementation UIxJSONPreferences +- (WOResponse *) _makeResponse: (NSString *) jsonText +{ + WOResponse *response; + + response = [context response]; + [response setHeader: @"text/plain; charset=utf-8" + forKey: @"content-type"]; + [response appendContentString: jsonText]; + + return response; +} + - (WOResponse *) jsonDefaultsAction { NSUserDefaults *defaults; defaults = [[context activeUser] userDefaults]; - return [defaults jsonRepresentation]; + return [self _makeResponse: [defaults jsonRepresentation]]; } - (WOResponse *) jsonSettingsAction @@ -46,7 +60,7 @@ settings = [[context activeUser] userSettings]; - return [settings jsonRepresentation]; + return [self _makeResponse: [settings jsonRepresentation]]; } @end