Monotone-Parent: c494ba259363880f5d46e8931a1708d1ba1aed45

Monotone-Revision: 5f57280bc0c8371b942a310b60e1dfa1a790fb84

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-09-30T18:05:14
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau committed 2010-09-30 18:05:14 +00:00
1 parent 80df885644
commit 79fc9f4c26
30 files changed
+712 -10

No files matched your search

+37
View File
@@ -231,4 +231,41 @@
return [self redirectToLocation: url];
}
- (WOResponse *) _performDelegationAction: (SEL) action
{
SOGoMailAccount *co;
WOResponse *response;
NSString *uid;
co = [self clientObject];
if ([[co nameInContainer] isEqualToString: @"0"])
{
uid = [[context request] formValueForKey: @"uid"];
if ([uid length] > 0)
{
[co performSelector: action
withObject: [NSArray arrayWithObject: uid]];
response = [self responseWith204];
}
else
response = [self responseWithStatus: 500
andString: @"Missing 'uid' parameter."];
}
else
response = [self responseWithStatus: 403
andString: @"This action cannot be performed on secondary accounts."];
return response;
}
- (WOResponse *) addDelegateAction
{
return [self _performDelegationAction: @selector (addDelegates:)];
}
- (WOResponse *) removeDelegateAction
{
return [self _performDelegationAction: @selector (removeDelegates:)];
}
@end