diff --git a/UI/Common/UIxFolderActions.m b/UI/Common/UIxFolderActions.m index ca14b9d5e..b7a469a00 100644 --- a/UI/Common/UIxFolderActions.m +++ b/UI/Common/UIxFolderActions.m @@ -37,6 +37,8 @@ #import #import +#import "WODirectAction+SOGo.h" + #import "UIxFolderActions.h" @implementation UIxFolderActions @@ -89,10 +91,9 @@ NSMutableDictionary *folderSubscription; NSString *mailInvitationURL; - response = [context response]; if ([owner isEqualToString: login]) { - [response setStatus: 403]; + response = [self responseWithStatus: 403]; [response appendContentString: @"You cannot (un)subscribe to a folder that you own!"]; } @@ -119,12 +120,12 @@ mailInvitationURL = [[clientObject soURLToBaseContainerForCurrentUser] absoluteString]; - [response setStatus: 302]; + response = [self responseWithStatus: 302]; [response setHeader: mailInvitationURL forKey: @"location"]; } else - [response setStatus: 204]; + response = [self responseWith204]; } return response; @@ -162,22 +163,14 @@ - (WOResponse *) canAccessContentAction { - WOResponse *response; - - response = [context response]; - [response setStatus: 204]; - - return response; + return [self responseWith204]; } - (WOResponse *) _realFolderActivation: (BOOL) makeActive { - WOResponse *response; NSMutableDictionary *folderSubscription, *folderDict; NSNumber *active; - response = [context response]; - [self _setupContext]; active = [NSNumber numberWithBool: makeActive]; if ([owner isEqualToString: login]) @@ -196,9 +189,8 @@ } [ud synchronize]; - [response setStatus: 204]; - return response; + return [self responseWith204]; } - (WOResponse *) activateFolderAction diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index c88e9af4f..d4bdc2070 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -69,7 +69,7 @@ auth = [[WOApplication application] authenticatorInContext: context]; - response = [context response]; + response = [self responseWith204]; cookieString = [NSString stringWithFormat: @"%@:%@", [self queryParameterForKey: @"userName"], [self queryParameterForKey: @"password"]]; @@ -78,7 +78,6 @@ authCookie = [WOCookie cookieWithName: [auth cookieNameInContext: context] value: cookieValue]; [authCookie setPath: @"/"]; - [response setStatus: 204]; [response addCookie: authCookie]; return response; diff --git a/UI/Scheduler/UIxCalListingActions.m b/UI/Scheduler/UIxCalListingActions.m index 03f647f9d..34a1ec92d 100644 --- a/UI/Scheduler/UIxCalListingActions.m +++ b/UI/Scheduler/UIxCalListingActions.m @@ -39,6 +39,8 @@ #import #import +#import + #import "NSArray+Scheduler.h" #import "UIxCalListingActions.h" @@ -289,10 +291,9 @@ { WOResponse *response; - response = [context response]; + response = [self responseWithStatus: 200]; [response setHeader: @"text/plain; charset=utf-8" forKey: @"content-type"]; - [response setStatus: 200]; [response appendContentString: [data jsonRepresentation]]; return response;