Monotone-Parent: 925d096d1e0f9b05775333d6111c325f69a17ac0

Monotone-Revision: cadb1dbd9d4e2d99af291da99b803238fd438921

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-01-16T18:50:17
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2008-01-16 18:50:17 +00:00
parent 01e97af01c
commit 1ed587058e
16 changed files with 129 additions and 508 deletions
@@ -48,7 +48,6 @@
#import <SaxObjC/XMLNamespaces.h>
// #import <NGObjWeb/SoClassSecurityInfo.h>
#import <SOGo/SOGoCache.h>
#import <SOGo/SOGoCustomGroupFolder.h>
#import <SOGo/LDAPUserManager.h>
#import <SOGo/SOGoPermissions.h>
@@ -300,8 +299,8 @@ static NSNumber *sharedYes = nil;
[r setStatus: 207];
[r setContentEncoding: NSUTF8StringEncoding];
[r setHeader: @"text/xml; charset=\"utf-8\"" forKey: @"content-type"];
// [r setHeader: @"no-cache" forKey: @"pragma"];
// [r setHeader: @"no-cache" forKey: @"cache-control"];
[r setHeader: @"no-cache" forKey: @"pragma"];
[r setHeader: @"no-cache" forKey: @"cache-control"];
[r appendContentString:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"];
[r appendContentString: @"<D:multistatus xmlns:D=\"DAV:\""
@" xmlns:C=\"urn:ietf:params:xml:ns:caldav\">\r\n"];
@@ -404,11 +403,6 @@ static NSNumber *sharedYes = nil;
obj = [NSException exceptionWithHTTPStatus:404 /* Not Found */];
}
if (obj)
[[SOGoCache sharedCache] registerObject: obj
withName: _key
inContainer: container];
return obj;
}
@@ -126,7 +126,7 @@ static BOOL sendEMailNotifications = NO;
sm = [SoSecurityManager sharedSecurityManager];
if (![sm validatePermission: SOGoCalendarPerm_ViewAllComponent
onObject: self inContext: context])
iCalString = [record objectForKey: @"c_content"];
iCalString = content;
else if (![sm validatePermission: SOGoCalendarPerm_ViewDAndT
onObject: self inContext: context])
{
@@ -165,7 +165,7 @@ static BOOL sendEMailNotifications = NO;
if (secure)
iCalString = [self secureContentAsString];
else
iCalString = [record objectForKey: @"c_content"];
iCalString = content;
if ([iCalString length] > 0)
calendar = [iCalCalendar parseSingleFromSource: iCalString];
-3
View File
@@ -48,11 +48,8 @@
- (NGVCard *) vCard
{
NSString *content;
if (!card)
{
content = [record objectForKey: @"c_content"];
if ([[content uppercaseString] hasPrefix: @"BEGIN:VCARD"])
card = [NGVCard parseSingleFromSource: content];
else
+1 -1
View File
@@ -104,7 +104,7 @@ static NSString *AgenorShareLoginMarker = @".-.";
/* first check attributes directly bound to the application */
if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
return obj;
if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
[self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@",
userLogin, [container nameInContainer]];
+1 -1
View File
@@ -850,7 +850,7 @@ static BOOL debugSoParts = NO;
}
else
clazz = Nil;
return [clazz objectWithName:_key inContainer: self];
}
-2
View File
@@ -20,7 +20,6 @@ libSOGo_HEADER_FILES_INSTALL_DIR = /SOGo
FHS_HEADER_DIRS = SOGo
libSOGo_HEADER_FILES = \
SOGoCache.h \
SOGoObject.h \
SOGoContentObject.h \
SOGoFolder.h \
@@ -57,7 +56,6 @@ libSOGo_HEADER_FILES = \
WORequest+SOGo.h
libSOGo_OBJC_FILES = \
SOGoCache.m \
SOGoObject.m \
SOGoContentObject.m \
SOGoFolder.m \
+1 -1
View File
@@ -31,7 +31,7 @@
@interface SOGoContentObject : SOGoObject
{
NSString *ocsPath;
NSDictionary *record;
NSString *content;
BOOL isNew;
}
+20 -21
View File
@@ -49,9 +49,9 @@
if ((self = [super initWithName: newName inContainer: newContainer]))
{
ocsPath = nil;
record = [[self ocsFolder] recordOfEntryWithName: newName];
[record retain];
isNew = (!record);
content = [[self ocsFolder] fetchContentWithName: newName];
[content retain];
isNew = (!content);
}
return self;
@@ -59,11 +59,19 @@
- (void) dealloc
{
[record release];
[content release];
[ocsPath release];
[super dealloc];
}
/* notifications */
- (void) sleep
{
[content release]; content = nil;
[super sleep];
}
/* accessors */
- (BOOL) isFolderish
@@ -128,25 +136,19 @@
- (NSString *) contentAsString
{
return [record objectForKey: @"c_content"];
return content;
}
- (NSException *) saveContentString: (NSString *) newContent
baseVersion: (unsigned int) newBaseVersion
{
/* Note: "iCal multifolder saves" are implemented in the apt subclass! */
GCSFolder *folder;
GCSFolder *folder;
NSException *ex;
NSMutableDictionary *newRecord;
ex = nil;
if (record)
newRecord = [NSMutableDictionary dictionaryWithDictionary: record];
else
newRecord = [NSMutableDictionary dictionary];
[newRecord setObject: newContent forKey: @"c_content"];
ASSIGN (record, newRecord);
ASSIGN (content, newContent);
folder = [container ocsFolder];
if (folder)
@@ -305,7 +307,7 @@
folder = [self ocsFolder];
if (folder)
{
versionValue = [record objectForKey: @"c_version"];
versionValue = [folder versionOfContentWithName: [self nameInContainer]];
sprintf (buf, "\"gcs%08d\"", [versionValue unsignedIntValue]);
entityTag = [NSString stringWithCString: buf];
}
@@ -323,7 +325,7 @@
{
NSCalendarDate *date;
date = [record objectForKey: @"c_creationdate"];
date = [[self ocsFolder] creationDateOfEntryWithName: nameInContainer];
return [date rfc822DateString];
}
@@ -332,19 +334,16 @@
{
NSCalendarDate *date;
date = [record objectForKey: @"c_lastmodified"];
date = [[self ocsFolder] lastModificationOfEntryWithName: nameInContainer];
return [date rfc822DateString];
}
- (NSString *) davContentLength
{
NSString *content;
content = [record objectForKey: @"c_content"];
return [NSString stringWithFormat: @"%u",
[content lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]];
[content
lengthOfBytesUsingEncoding: NSISOLatin1StringEncoding]];
}
- (NSException *) davMoveToTargetObject: (id) _target
+3 -13
View File
@@ -62,7 +62,6 @@
#import "NSDictionary+Utilities.h"
#import "NSString+Utilities.h"
#import "SOGoCache.h"
#import "SOGoObject.h"
@interface SOGoObject(Content)
@@ -561,19 +560,10 @@ static BOOL kontactGroupDAV = YES;
acquire: (BOOL) acquire
{
id obj;
SOGoCache *cache;
cache = [SOGoCache sharedCache];
obj = [cache objectNamed: lookupName inContainer: self];
if (!obj)
{
obj = [[self soClass] lookupKey: lookupName inContext: localContext];
if (obj)
{
[obj bindToObject: self inContext: localContext];
[cache registerObject: obj withName: lookupName inContainer: self];
}
}
obj = [[self soClass] lookupKey: lookupName inContext: localContext];
if (obj)
[obj bindToObject: self inContext: localContext];
return obj;
}
+3 -17
View File
@@ -32,11 +32,10 @@
#import "AgenorUserDefaults.h"
#import "LDAPUserManager.h"
#import "NSArray+Utilities.h"
#import "SOGoCache.h"
#import "SOGoDateFormatter.h"
#import "SOGoObject.h"
#import "SOGoPermissions.h"
#import "NSArray+Utilities.h"
#import "SOGoUser.h"
@@ -125,18 +124,10 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
+ (SOGoUser *) userWithLogin: (NSString *) newLogin
roles: (NSArray *) newRoles
{
SOGoCache *cache;
SOGoUser *user;
cache = [SOGoCache sharedCache];
user = [cache userNamed: newLogin];
if (!user)
{
user = [[self alloc] initWithLogin: newLogin roles: newRoles];
[user autorelease];
[cache registerUser: user];
}
[user setPrimaryRoles: newRoles];
user = [[self alloc] initWithLogin: newLogin roles: newRoles];
[user autorelease];
return user;
}
@@ -190,11 +181,6 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
[super dealloc];
}
- (void) setPrimaryRoles: (NSArray *) newRoles
{
ASSIGN (roles, newRoles);
}
- (void) setCurrentPassword: (NSString *) newPassword
{
ASSIGN (currentPassword, newPassword);