Monotone-Parent: cbba640dfc6321c0f4565ae72d616bc60cb20407
Monotone-Revision: 1f959c8c87357cf8d3745bf7b492bc7800597701 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-01-16T18:59:58 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
aee48dc4e2
commit
cdedcdfa10
|
@ -126,7 +126,7 @@ static BOOL sendEMailNotifications = NO;
|
||||||
sm = [SoSecurityManager sharedSecurityManager];
|
sm = [SoSecurityManager sharedSecurityManager];
|
||||||
if (![sm validatePermission: SOGoCalendarPerm_ViewAllComponent
|
if (![sm validatePermission: SOGoCalendarPerm_ViewAllComponent
|
||||||
onObject: self inContext: context])
|
onObject: self inContext: context])
|
||||||
iCalString = content;
|
iCalString = [record objectForKey: @"c_content"];
|
||||||
else if (![sm validatePermission: SOGoCalendarPerm_ViewDAndT
|
else if (![sm validatePermission: SOGoCalendarPerm_ViewDAndT
|
||||||
onObject: self inContext: context])
|
onObject: self inContext: context])
|
||||||
{
|
{
|
||||||
|
@ -165,7 +165,7 @@ static BOOL sendEMailNotifications = NO;
|
||||||
if (secure)
|
if (secure)
|
||||||
iCalString = [self secureContentAsString];
|
iCalString = [self secureContentAsString];
|
||||||
else
|
else
|
||||||
iCalString = content;
|
iCalString = [record objectForKey: @"c_content"];
|
||||||
|
|
||||||
if ([iCalString length] > 0)
|
if ([iCalString length] > 0)
|
||||||
calendar = [iCalCalendar parseSingleFromSource: iCalString];
|
calendar = [iCalCalendar parseSingleFromSource: iCalString];
|
||||||
|
|
|
@ -48,8 +48,11 @@
|
||||||
|
|
||||||
- (NGVCard *) vCard
|
- (NGVCard *) vCard
|
||||||
{
|
{
|
||||||
|
NSString *content;
|
||||||
|
|
||||||
if (!card)
|
if (!card)
|
||||||
{
|
{
|
||||||
|
content = [record objectForKey: @"c_content"];
|
||||||
if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"])
|
if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"])
|
||||||
card = [NGVCard parseSingleFromSource: content];
|
card = [NGVCard parseSingleFromSource: content];
|
||||||
else
|
else
|
||||||
|
|
|
@ -104,7 +104,7 @@ static NSString *AgenorShareLoginMarker = @".-.";
|
||||||
/* first check attributes directly bound to the application */
|
/* first check attributes directly bound to the application */
|
||||||
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
|
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
|
||||||
return obj;
|
return obj;
|
||||||
|
|
||||||
if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
|
if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
|
||||||
[self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@",
|
[self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@",
|
||||||
userLogin, [container nameInContainer]];
|
userLogin, [container nameInContainer]];
|
||||||
|
|
|
@ -850,7 +850,7 @@ static BOOL debugSoParts = NO;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
clazz = Nil;
|
clazz = Nil;
|
||||||
|
|
||||||
return [clazz objectWithName:_key inContainer: self];
|
return [clazz objectWithName:_key inContainer: self];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
@interface SOGoContentObject : SOGoObject
|
@interface SOGoContentObject : SOGoObject
|
||||||
{
|
{
|
||||||
NSString *ocsPath;
|
NSString *ocsPath;
|
||||||
NSString *content;
|
NSDictionary *record;
|
||||||
BOOL isNew;
|
BOOL isNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@
|
||||||
if ((self = [super initWithName: newName inContainer: newContainer]))
|
if ((self = [super initWithName: newName inContainer: newContainer]))
|
||||||
{
|
{
|
||||||
ocsPath = nil;
|
ocsPath = nil;
|
||||||
content = [[self ocsFolder] fetchContentWithName: newName];
|
record = [[self ocsFolder] recordOfEntryWithName: newName];
|
||||||
[content retain];
|
[record retain];
|
||||||
isNew = (!content);
|
isNew = (!record);
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -59,19 +59,11 @@
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
[content release];
|
[record release];
|
||||||
[ocsPath release];
|
[ocsPath release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* notifications */
|
|
||||||
|
|
||||||
- (void) sleep
|
|
||||||
{
|
|
||||||
[content release]; content = nil;
|
|
||||||
[super sleep];
|
|
||||||
}
|
|
||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
|
||||||
- (BOOL) isFolderish
|
- (BOOL) isFolderish
|
||||||
|
@ -136,19 +128,25 @@
|
||||||
|
|
||||||
- (NSString *) contentAsString
|
- (NSString *) contentAsString
|
||||||
{
|
{
|
||||||
return content;
|
return [record objectForKey: @"c_content"];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSException *) saveContentString: (NSString *) newContent
|
- (NSException *) saveContentString: (NSString *) newContent
|
||||||
baseVersion: (unsigned int) newBaseVersion
|
baseVersion: (unsigned int) newBaseVersion
|
||||||
{
|
{
|
||||||
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
|
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
|
||||||
GCSFolder *folder;
|
GCSFolder *folder;
|
||||||
NSException *ex;
|
NSException *ex;
|
||||||
|
NSMutableDictionary *newRecord;
|
||||||
|
|
||||||
ex = nil;
|
ex = nil;
|
||||||
|
|
||||||
ASSIGN (content, newContent);
|
if (record)
|
||||||
|
newRecord = [NSMutableDictionary dictionaryWithDictionary: record];
|
||||||
|
else
|
||||||
|
newRecord = [NSMutableDictionary dictionary];
|
||||||
|
[newRecord setObject: newContent forKey: @"c_content"];
|
||||||
|
ASSIGN (record, newRecord);
|
||||||
|
|
||||||
folder = [container ocsFolder];
|
folder = [container ocsFolder];
|
||||||
if (folder)
|
if (folder)
|
||||||
|
@ -307,7 +305,7 @@
|
||||||
folder = [self ocsFolder];
|
folder = [self ocsFolder];
|
||||||
if (folder)
|
if (folder)
|
||||||
{
|
{
|
||||||
versionValue = [folder versionOfContentWithName: [self nameInContainer]];
|
versionValue = [record objectForKey: @"c_version"];
|
||||||
sprintf (buf, "\"gcs%08d\"", [versionValue unsignedIntValue]);
|
sprintf (buf, "\"gcs%08d\"", [versionValue unsignedIntValue]);
|
||||||
entityTag = [NSString stringWithCString: buf];
|
entityTag = [NSString stringWithCString: buf];
|
||||||
}
|
}
|
||||||
|
@ -325,7 +323,7 @@
|
||||||
{
|
{
|
||||||
NSCalendarDate *date;
|
NSCalendarDate *date;
|
||||||
|
|
||||||
date = [[self ocsFolder] creationDateOfEntryWithName: nameInContainer];
|
date = [record objectForKey: @"c_creationdate"];
|
||||||
|
|
||||||
return [date rfc822DateString];
|
return [date rfc822DateString];
|
||||||
}
|
}
|
||||||
|
@ -334,16 +332,19 @@
|
||||||
{
|
{
|
||||||
NSCalendarDate *date;
|
NSCalendarDate *date;
|
||||||
|
|
||||||
date = [[self ocsFolder] lastModificationOfEntryWithName: nameInContainer];
|
date = [record objectForKey: @"c_lastmodified"];
|
||||||
|
|
||||||
return [date rfc822DateString];
|
return [date rfc822DateString];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) davContentLength
|
- (NSString *) davContentLength
|
||||||
{
|
{
|
||||||
|
NSString *content;
|
||||||
|
|
||||||
|
content = [record objectForKey: @"c_content"];
|
||||||
|
|
||||||
return [NSString stringWithFormat: @"%u",
|
return [NSString stringWithFormat: @"%u",
|
||||||
[content
|
[content lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]];
|
||||||
lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSException *) davMoveToTargetObject: (id) _target
|
- (NSException *) davMoveToTargetObject: (id) _target
|
||||||
|
|
Loading…
Reference in New Issue