mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-01 16:39:46 +00:00
Monotone-Parent: 6303f532fa4bb3c36fe2f298f62f659c4fc71b18
Monotone-Revision: c111ae7ec8c39efb8d0cc56ff4627bb958ff0cc8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2012-04-18T20:03:07
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user