mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-21 11:25:24 +00:00
Monotone-Parent: 50485da98a8b2535a5e2511ba4e1bd8025373815
Monotone-Revision: 3539ecd8be9d6a343ed36dd75849ea9713497066 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-19T17:05:28 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -128,4 +128,43 @@ static NSMutableArray *yearMenuItems = nil;
|
||||
return response;
|
||||
}
|
||||
|
||||
- (id <WOActionResults>) checkRightsAction
|
||||
{
|
||||
WOResponse *response;
|
||||
NSUserDefaults *ud;
|
||||
NSString *uids, *uid;
|
||||
NSMutableString *rights;
|
||||
NSArray *ids;
|
||||
unsigned int count, max;
|
||||
BOOL result;
|
||||
|
||||
ud = [[context activeUser] userDefaults];
|
||||
uids = [ud stringForKey: @"calendaruids"];
|
||||
|
||||
response = [context response];
|
||||
[response setStatus: 200];
|
||||
[response setHeader: @"text/plain; charset=\"utf-8\""
|
||||
forKey: @"content-type"];
|
||||
rights = [NSMutableString string];
|
||||
if ([uids length] > 0)
|
||||
{
|
||||
ids = [uids componentsSeparatedByString: @","];
|
||||
max = [ids count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
uid = [ids objectAtIndex: count];
|
||||
if ([uid hasPrefix: @"-"])
|
||||
uid = [uid substringFromIndex: 1];
|
||||
result = ([self calendarFolderForUID: uid] != nil);
|
||||
if (count == 0)
|
||||
[rights appendFormat: @"%d", result];
|
||||
else
|
||||
[rights appendFormat: @",%d", result];
|
||||
}
|
||||
}
|
||||
[response appendContentString: rights];
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user