Monotone-Parent: 42150bca7cff4d10d636557c189a1431f47637d5
Monotone-Revision: ce2a8f7b1f3d8638da3f2af27fc3284288b4f1d6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-20T22:52:32 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
87d5799b72
commit
702b62f072
|
@ -1,5 +1,9 @@
|
||||||
2006-12-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2006-12-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView
|
||||||
|
-checkRightsAction]): new method similar to the one with the same
|
||||||
|
name in UIxCalMainView.m.
|
||||||
|
|
||||||
* UI/Common/UIxAclEditor.m ([UIxAclEditor -saveAclsAction]): added
|
* UI/Common/UIxAclEditor.m ([UIxAclEditor -saveAclsAction]): added
|
||||||
code to handle the publishing of freebusy information.
|
code to handle the publishing of freebusy information.
|
||||||
|
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||||
#import <SoObjects/Contacts/SOGoContactFolders.h>
|
#import <SoObjects/Contacts/SOGoContactFolders.h>
|
||||||
#import <SoObjects/Contacts/SOGoContactFolder.h>
|
#import <SoObjects/Contacts/SOGoContactFolder.h>
|
||||||
|
#import <SoObjects/Contacts/SOGoContactGCSFolder.h>
|
||||||
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
|
@ -210,4 +211,67 @@
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (SOGoContactGCSFolder *) contactFolderForUID: (NSString *) uid
|
||||||
|
{
|
||||||
|
SOGoFolder *upperContainer;
|
||||||
|
SOGoUserFolder *userFolder;
|
||||||
|
SOGoContactFolders *contactFolders;
|
||||||
|
SOGoContactGCSFolder *contactFolder;
|
||||||
|
SoSecurityManager *securityManager;
|
||||||
|
|
||||||
|
upperContainer = [[[self clientObject] container] container];
|
||||||
|
userFolder = [SOGoUserFolder objectWithName: uid
|
||||||
|
inContainer: upperContainer];
|
||||||
|
contactFolders = [SOGoContactFolders objectWithName: @"Contacts"
|
||||||
|
inContainer: userFolder];
|
||||||
|
contactFolder = [SOGoContactGCSFolder objectWithName: @"personal"
|
||||||
|
inContainer: contactFolders];
|
||||||
|
[contactFolder
|
||||||
|
setOCSPath: [NSString stringWithFormat: @"/Users/%@/Contacts/personal", uid]];
|
||||||
|
[contactFolder setOwner: uid];
|
||||||
|
|
||||||
|
securityManager = [SoSecurityManager sharedSecurityManager];
|
||||||
|
|
||||||
|
return (([securityManager validatePermission: SoPerm_AccessContentsInformation
|
||||||
|
onObject: contactFolder
|
||||||
|
inContext: context] == nil)
|
||||||
|
? contactFolder : nil);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id <WOActionResults>) checkRightsAction
|
||||||
|
{
|
||||||
|
WOResponse *response;
|
||||||
|
NSUserDefaults *ud;
|
||||||
|
NSString *uids;
|
||||||
|
NSMutableString *rights;
|
||||||
|
NSArray *ids;
|
||||||
|
unsigned int count, max;
|
||||||
|
BOOL result;
|
||||||
|
|
||||||
|
ud = [[context activeUser] userDefaults];
|
||||||
|
uids = [ud objectForKey: @"additionaladdressbooks"];
|
||||||
|
|
||||||
|
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++)
|
||||||
|
{
|
||||||
|
result = ([self contactFolderForUID: [ids objectAtIndex: count]] != nil);
|
||||||
|
if (count == 0)
|
||||||
|
[rights appendFormat: @"%d", result];
|
||||||
|
else
|
||||||
|
[rights appendFormat: @",%d", result];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
[response appendContentString: rights];
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
Loading…
Reference in New Issue