Monotone-Parent: 6303f532fa4bb3c36fe2f298f62f659c4fc71b18

Monotone-Revision: c111ae7ec8c39efb8d0cc56ff4627bb958ff0cc8

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-04-18T20:03:07
This commit is contained in:
Wolfgang Sourdeau
2012-04-18 20:03:07 +00:00
parent bd982aa4c3
commit c804d5ccfe
6 changed files with 359 additions and 64 deletions
+43 -3
View File
@@ -20,12 +20,13 @@
*/
#import <Foundation/NSValue.h>
#import <SoObjects/SOGo/NSDictionary+Utilities.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGObjWeb/WORequest.h>
#import <SOGo/NSDictionary+Utilities.h>
#import <Appointments/SOGoAppointmentFolder.h>
#import <Appointments/SOGoWebAppointmentFolder.h>
#import <Appointments/SOGoAppointmentFolderICS.h>
#import "UIxCalFolderActions.h"
@@ -95,4 +96,43 @@
return response;
}
/* These methods are only available on instance of SOGoWebAppointmentFolder. */
- (WOResponse *) reloadAction
{
WOResponse *response;
NSDictionary *results;
response = [self responseWithStatus: 200];
[response setHeader: @"application/json" forKey: @"content-type"];
results = [[self clientObject] loadWebCalendar];
[response appendContentString: [results jsonRepresentation]];
return response;
}
- (WOResponse *) setCredentialsAction
{
WORequest *request;
WOResponse *response;
NSString *username, *password;
request = [context request];
username = [[request formValueForKey: @"username"] stringByTrimmingSpaces];
password = [[request formValueForKey: @"password"] stringByTrimmingSpaces];
if ([username length] > 0 && [password length] > 0)
{
[[self clientObject] setUsername: username
andPassword: password];
response = [self responseWith204];
}
else
response
= (WOResponse *) [NSException exceptionWithHTTPStatus: 400
reason: @"missing 'username' and/or"
@" 'password' parameters"];
return response;
}
@end /* UIxCalFolderActions */