From e48f07017f7c778006cdd9329490b38741127191 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Tue, 18 Mar 2008 17:31:18 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1389 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 20 + ...et-r1608.diff => sope-patchset-r1618.diff} | 473 +++++++++--------- .../Appointments/SOGoAppointmentFolder.m | 372 ++++++++++++-- .../Appointments/SOGoCalendarComponent.m | 5 + SoObjects/SOGo/SOGoObject.m | 6 +- SoObjects/SOGo/SOGoPermissions.h | 1 - 6 files changed, 600 insertions(+), 277 deletions(-) rename SOPE/{sope-patchset-r1608.diff => sope-patchset-r1618.diff} (96%) diff --git a/ChangeLog b/ChangeLog index b2af91ff..3bbda7cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-03-18 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoAppointmentFolder.m + ([SOGoAppointmentFolder -davCalendarMultiget:queryContext]): + implemented new CalDAV method. + ([SOGoAppointmentFolder -davCalendarQuery:queryContext]): + refactored method to return exactly the properties requested in + the query and to share code with the new method above. + + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent -davCalendarData]): added method for + better CalDAV compliance. + +2008-03-17 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoObject.m ([SOGoObject + -davAclQuery:queryContext]): declare the "text/xml" mime type only + when the content is not empty. Otherwise, returns no mime type at + all and set the status code to 204. + 2008-03-10 Wolfgang Sourdeau * UI/Scheduler/UIxCalMonthViewOld.m ([UIxCalMonthViewOld diff --git a/SOPE/sope-patchset-r1608.diff b/SOPE/sope-patchset-r1618.diff similarity index 96% rename from SOPE/sope-patchset-r1608.diff rename to SOPE/sope-patchset-r1618.diff index 1317158f..38306917 100644 --- a/SOPE/sope-patchset-r1608.diff +++ b/SOPE/sope-patchset-r1618.diff @@ -1,184 +1,6 @@ -Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m -=================================================================== ---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1608) -+++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) -@@ -713,6 +713,39 @@ - return ms; - } - -+/* GCSEOAdaptorChannel protocol */ -+static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_name VARCHAR (256) NOT NULL,\n" -+ @" c_content VARCHAR (100000) NOT NULL,\n" -+ @" c_creationdate INT4 NOT NULL,\n" -+ @" c_lastmodified INT4 NOT NULL,\n" -+ @" c_version INT4 NOT NULL,\n" -+ @" c_deleted INT4 NULL\n" -+ @")"); -+static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ -+ @" c_uid VARCHAR (256) NOT NULL,\n" -+ @" c_object VARCHAR (256) NOT NULL,\n" -+ @" c_role VARCHAR (80) NOT NULL\n" -+ @")"); -+ -+- (NSException *) createGCSFolderTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ -+- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName -+{ -+ NSString *sql; -+ -+ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; -+ -+ return [self evaluateExpressionX: sql]; -+} -+ - @end /* PostgreSQL72Channel */ - - @implementation PostgreSQL72Channel(PrimaryKeyGeneration) -Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1608) -+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) -@@ -30,6 +30,7 @@ - - #import - -+static BOOL debugOn = NO; - // - // - // -@@ -41,10 +42,19 @@ - - @implementation OracleAdaptorChannel (Private) - --- (void) _cleanup -++ (void) initialize - { -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ -+- (void) _cleanup -+{ - column_info *info; - int c; -+ sword result; - - [_resultSetProperties removeAllObjects]; - -@@ -58,11 +68,29 @@ - // so we just free the value instead. - if (info->value) - { -- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) -+ if (info->type == SQLT_CLOB -+ || info->type == SQLT_BLOB -+ || info->type == SQLT_BFILEE -+ || info->type == SQLT_CFILEE) -+ { -+ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); -+ if (result != OCI_SUCCESS) -+ { -+ NSLog (@"value was not a LOB descriptor"); -+ abort(); -+ } -+ } -+ else - free(info->value); - info->value = NULL; - } -- free(info); -+ else -+ { -+ NSLog (@"trying to free an already freed value!"); -+ abort(); -+ } -+ free(info); -+ - [_row_buffer removeObjectAtIndex: c]; - } - -@@ -231,6 +259,9 @@ - - [self _cleanup]; - -+ if (debugOn) -+ [self logWithFormat: @"expression: %@", theExpression]; -+ - if (!theExpression || ![theExpression length]) - { - [NSException raise: @"OracleInvalidExpressionException" -@@ -302,7 +333,9 @@ - // We read the maximum width of a column - info->max_width = 0; - status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); -- -+ -+ if (debugOn) -+ NSLog(@"name: %s, type: %d", cname, info->type); - attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; - [_resultSetProperties addObject: attribute]; - -Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m -=================================================================== ---- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1608) -+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) -@@ -31,6 +31,8 @@ - #import - #import - -+static BOOL debugOn = NO; -+ - // - // - // -@@ -48,6 +50,14 @@ - // - @implementation OracleAdaptorChannelController - -++ (void) initialize -+{ -+ NSUserDefaults *ud; -+ -+ ud = [NSUserDefaults standardUserDefaults]; -+ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; -+} -+ - - (EODelegateResponse) adaptorChannel: (id) theChannel - willInsertRow: (NSMutableDictionary *) theRow - forEntity: (EOEntity *) theEntity -@@ -56,7 +66,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); -+ if (debugOn) -+ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - -@@ -101,7 +112,8 @@ - NSArray *keys; - int i, c; - -- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); -+ if (debugOn) -+ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); - - s = AUTORELEASE([[NSMutableString alloc] init]); - Index: sope-mime/NGImap4/NGImap4Connection.m =================================================================== ---- sope-mime/NGImap4/NGImap4Connection.m (révision 1608) +--- sope-mime/NGImap4/NGImap4Connection.m (révision 1618) +++ sope-mime/NGImap4/NGImap4Connection.m (copie de travail) @@ -381,7 +381,7 @@ @@ -191,7 +13,7 @@ Index: sope-mime/NGImap4/NGImap4Connection.m [self errorWithFormat:@"Could not list mailbox hierarchy!"]; Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1608) +--- sope-mime/NGImap4/NGImap4ResponseNormalizer.m (révision 1618) +++ sope-mime/NGImap4/NGImap4ResponseNormalizer.m (copie de travail) @@ -648,14 +648,13 @@ enumerator = [_flags objectEnumerator]; @@ -217,7 +39,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseNormalizer.m if (objs) free(objs); Index: sope-mime/NGImap4/NGImap4ResponseParser.m =================================================================== ---- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1608) +--- sope-mime/NGImap4/NGImap4ResponseParser.m (révision 1618) +++ sope-mime/NGImap4/NGImap4ResponseParser.m (copie de travail) @@ -84,6 +84,8 @@ static NSDictionary *_parseMultipartBody(NGImap4ResponseParser *self, @@ -442,7 +264,7 @@ Index: sope-mime/NGImap4/NGImap4ResponseParser.m { Index: sope-mime/NGMail/NGSmtpClient.m =================================================================== ---- sope-mime/NGMail/NGSmtpClient.m (révision 1608) +--- sope-mime/NGMail/NGSmtpClient.m (révision 1618) +++ sope-mime/NGMail/NGSmtpClient.m (copie de travail) @@ -24,6 +24,82 @@ #include "NGSmtpReplyCodes.h" @@ -598,7 +420,7 @@ Index: sope-mime/NGMail/NGSmtpClient.m reply = [self receiveReply]; Index: sope-mime/NGMail/NGMimeMessageGenerator.m =================================================================== ---- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1608) +--- sope-mime/NGMail/NGMimeMessageGenerator.m (révision 1618) +++ sope-mime/NGMail/NGMimeMessageGenerator.m (copie de travail) @@ -86,37 +86,40 @@ char *des = NULL; @@ -664,7 +486,7 @@ Index: sope-mime/NGMail/NGMimeMessageGenerator.m unsigned isoEndLen = 2; Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m =================================================================== ---- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1608) +--- sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (révision 1618) +++ sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m (copie de travail) @@ -19,88 +19,45 @@ 02111-1307, USA. @@ -1059,7 +881,7 @@ Index: sope-mime/NGMime/NGMimeRFC822DateHeaderFieldParser.m #if 0 Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m =================================================================== ---- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (révision 1608) +--- sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (révision 1618) +++ sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m (copie de travail) @@ -77,6 +77,7 @@ [rfc822Set setGenerator:gen forField:@"bcc"]; @@ -1071,7 +893,7 @@ Index: sope-mime/NGMime/NGMimeHeaderFieldGeneratorSet.m Index: sope-mime/NGMime/NGMimeBodyPart.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyPart.m (révision 1608) +--- sope-mime/NGMime/NGMimeBodyPart.m (révision 1618) +++ sope-mime/NGMime/NGMimeBodyPart.m (copie de travail) @@ -31,18 +31,6 @@ return 2; @@ -1109,7 +931,7 @@ Index: sope-mime/NGMime/NGMimeBodyPart.m - (NSString *)contentId { Index: sope-mime/NGMime/GNUmakefile.preamble =================================================================== ---- sope-mime/NGMime/GNUmakefile.preamble (révision 1608) +--- sope-mime/NGMime/GNUmakefile.preamble (révision 1618) +++ sope-mime/NGMime/GNUmakefile.preamble (copie de travail) @@ -5,6 +5,11 @@ -DLIBRARY_MINOR_VERSION=${MINOR_VERSION} \ @@ -1125,7 +947,7 @@ Index: sope-mime/NGMime/GNUmakefile.preamble -I../../sope-core/NGStreams/ \ Index: sope-mime/NGMime/NGMimeBodyParser.m =================================================================== ---- sope-mime/NGMime/NGMimeBodyParser.m (révision 1608) +--- sope-mime/NGMime/NGMimeBodyParser.m (révision 1618) +++ sope-mime/NGMime/NGMimeBodyParser.m (copie de travail) @@ -67,7 +67,10 @@ if (_data == nil) return nil; @@ -1141,7 +963,7 @@ Index: sope-mime/NGMime/NGMimeBodyParser.m Index: sope-mime/NGMime/NGMimePartParser.h =================================================================== ---- sope-mime/NGMime/NGMimePartParser.h (révision 1608) +--- sope-mime/NGMime/NGMimePartParser.h (révision 1618) +++ sope-mime/NGMime/NGMimePartParser.h (copie de travail) @@ -117,6 +117,7 @@ BOOL parserParseRawBodyDataOfPart:1; @@ -1163,7 +985,7 @@ Index: sope-mime/NGMime/NGMimePartParser.h @interface NSObject(NGMimePartParser) Index: sope-mime/NGMime/NGMimePartParser.m =================================================================== ---- sope-mime/NGMime/NGMimePartParser.m (révision 1608) +--- sope-mime/NGMime/NGMimePartParser.m (révision 1618) +++ sope-mime/NGMime/NGMimePartParser.m (copie de travail) @@ -227,7 +227,7 @@ } @@ -1188,7 +1010,7 @@ Index: sope-mime/NGMime/NGMimePartParser.m : [NGMimeType mimeType:[ctype stringValue]]; Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1608) +--- sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (révision 1618) +++ sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m (copie de travail) @@ -130,8 +130,13 @@ @@ -1219,7 +1041,7 @@ Index: sope-mime/NGMime/NGMimeAddressHeaderFieldGenerator.m bufLen = [data length]; Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m =================================================================== ---- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1608) +--- sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (révision 1618) +++ sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m (copie de travail) @@ -49,80 +49,70 @@ @@ -1353,9 +1175,187 @@ Index: sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m } return data; } +Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m +=================================================================== +--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1618) ++++ sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (copie de travail) +@@ -713,6 +713,39 @@ + return ms; + } + ++/* GCSEOAdaptorChannel protocol */ ++static NSString *sqlFolderFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_name VARCHAR (256) NOT NULL,\n" ++ @" c_content VARCHAR (100000) NOT NULL,\n" ++ @" c_creationdate INT4 NOT NULL,\n" ++ @" c_lastmodified INT4 NOT NULL,\n" ++ @" c_version INT4 NOT NULL,\n" ++ @" c_deleted INT4 NULL\n" ++ @")"); ++static NSString *sqlFolderACLFormat = (@"CREATE TABLE %@ (\n" \ ++ @" c_uid VARCHAR (256) NOT NULL,\n" ++ @" c_object VARCHAR (256) NOT NULL,\n" ++ @" c_role VARCHAR (80) NOT NULL\n" ++ @")"); ++ ++- (NSException *) createGCSFolderTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ ++- (NSException *) createGCSFolderACLTableWithName: (NSString *) tableName ++{ ++ NSString *sql; ++ ++ sql = [NSString stringWithFormat: sqlFolderACLFormat, tableName]; ++ ++ return [self evaluateExpressionX: sql]; ++} ++ + @end /* PostgreSQL72Channel */ + + @implementation PostgreSQL72Channel(PrimaryKeyGeneration) +Index: sope-gdl1/Oracle8/OracleAdaptorChannel.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannel.m (révision 1618) ++++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail) +@@ -30,6 +30,7 @@ + + #import + ++static BOOL debugOn = NO; + // + // + // +@@ -41,10 +42,19 @@ + + @implementation OracleAdaptorChannel (Private) + +-- (void) _cleanup +++ (void) initialize + { ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ ++- (void) _cleanup ++{ + column_info *info; + int c; ++ sword result; + + [_resultSetProperties removeAllObjects]; + +@@ -58,11 +68,29 @@ + // so we just free the value instead. + if (info->value) + { +- if (OCIDescriptorFree((dvoid *)info->value, (ub4)OCI_DTYPE_LOB) != OCI_SUCCESS) ++ if (info->type == SQLT_CLOB ++ || info->type == SQLT_BLOB ++ || info->type == SQLT_BFILEE ++ || info->type == SQLT_CFILEE) ++ { ++ result = OCIDescriptorFree((dvoid *)info->value, (ub4) OCI_DTYPE_LOB); ++ if (result != OCI_SUCCESS) ++ { ++ NSLog (@"value was not a LOB descriptor"); ++ abort(); ++ } ++ } ++ else + free(info->value); + info->value = NULL; + } +- free(info); ++ else ++ { ++ NSLog (@"trying to free an already freed value!"); ++ abort(); ++ } ++ free(info); ++ + [_row_buffer removeObjectAtIndex: c]; + } + +@@ -231,6 +259,9 @@ + + [self _cleanup]; + ++ if (debugOn) ++ [self logWithFormat: @"expression: %@", theExpression]; ++ + if (!theExpression || ![theExpression length]) + { + [NSException raise: @"OracleInvalidExpressionException" +@@ -302,7 +333,9 @@ + // We read the maximum width of a column + info->max_width = 0; + status = OCIAttrGet((dvoid*)param, (ub4)OCI_DTYPE_PARAM, (dvoid*)&(info->max_width), (ub4 *)0, (ub4)OCI_ATTR_DATA_SIZE, (OCIError *)_oci_err); +- ++ ++ if (debugOn) ++ NSLog(@"name: %s, type: %d", cname, info->type); + attribute = [EOAttribute attributeWithOracleType: info->type name: cname length: clen width: info->max_width]; + [_resultSetProperties addObject: attribute]; + +Index: sope-gdl1/Oracle8/OracleAdaptorChannelController.m +=================================================================== +--- sope-gdl1/Oracle8/OracleAdaptorChannelController.m (révision 1618) ++++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail) +@@ -31,6 +31,8 @@ + #import + #import + ++static BOOL debugOn = NO; ++ + // + // + // +@@ -48,6 +50,14 @@ + // + @implementation OracleAdaptorChannelController + +++ (void) initialize ++{ ++ NSUserDefaults *ud; ++ ++ ud = [NSUserDefaults standardUserDefaults]; ++ debugOn = [ud boolForKey: @"OracleAdaptorDebug"]; ++} ++ + - (EODelegateResponse) adaptorChannel: (id) theChannel + willInsertRow: (NSMutableDictionary *) theRow + forEntity: (EOEntity *) theEntity +@@ -56,7 +66,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); ++ if (debugOn) ++ NSLog(@"willInsertRow: %@ %@", [theRow description], [theEntity description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + +@@ -101,7 +112,8 @@ + NSArray *keys; + int i, c; + +- NSLog(@"willUpdatetRow: %@ %@", [theRow description], [theQualifier description]); ++ if (debugOn) ++ NSLog(@"willUpdateRow: %@ %@", [theRow description], [theQualifier description]); + + s = AUTORELEASE([[NSMutableString alloc] init]); + Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m =================================================================== ---- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1608) +--- sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (révision 1618) +++ sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m (copie de travail) @@ -140,8 +140,12 @@ @@ -1398,7 +1398,7 @@ Index: sope-core/NGExtensions/FdExt.subproj/NSString+Encoding.m static char *iconv_wrapper(id self, char *_src, unsigned _srcLen, Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m =================================================================== ---- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (révision 1608) +--- sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (révision 1618) +++ sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m (copie de travail) @@ -19,6 +19,7 @@ 02111-1307, USA. @@ -1410,7 +1410,7 @@ Index: sope-core/NGExtensions/EOExt.subproj/EOGlobalID+Ext.m Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1608) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (révision 1618) +++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h (copie de travail) @@ -19,6 +19,8 @@ 02111-1307, USA. @@ -1432,7 +1432,7 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.h id entityResolver; Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m =================================================================== ---- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1608) +--- sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (révision 1618) +++ sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m (copie de travail) @@ -30,6 +30,12 @@ #include @@ -1492,7 +1492,7 @@ Index: sope-xml/libxmlSAXDriver/libxmlHTMLSAXDriver.m - (void)tearDownParser { Index: sope-appserver/mod_ngobjweb/config.c =================================================================== ---- sope-appserver/mod_ngobjweb/config.c (révision 1608) +--- sope-appserver/mod_ngobjweb/config.c (révision 1618) +++ sope-appserver/mod_ngobjweb/config.c (copie de travail) @@ -21,7 +21,7 @@ @@ -1503,9 +1503,21 @@ Index: sope-appserver/mod_ngobjweb/config.c static char *_makeString(char *buf, char *str, int max) { if (buf == NULL) +Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c +=================================================================== +--- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (révision 1618) ++++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (copie de travail) +@@ -23,6 +23,7 @@ + #include + #include + #include ++#include "common.h" + #include "NGBufferedDescriptor.h" + + // returns the number of bytes which where read from the buffer Index: sope-appserver/mod_ngobjweb/GNUmakefile =================================================================== ---- sope-appserver/mod_ngobjweb/GNUmakefile (révision 1608) +--- sope-appserver/mod_ngobjweb/GNUmakefile (révision 1618) +++ sope-appserver/mod_ngobjweb/GNUmakefile (copie de travail) @@ -81,7 +81,7 @@ @@ -1516,21 +1528,9 @@ Index: sope-appserver/mod_ngobjweb/GNUmakefile LDFLAGS = $(APXS_LDFLAGS) $(APR_LDFLAGS) -shared -fPIC -Index: sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c -=================================================================== ---- sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (révision 1608) -+++ sope-appserver/mod_ngobjweb/NGBufferedDescriptor.c (copie de travail) -@@ -23,6 +23,7 @@ - #include - #include - #include -+#include "common.h" - #include "NGBufferedDescriptor.h" - - // returns the number of bytes which where read from the buffer Index: sope-appserver/mod_ngobjweb/handler.c =================================================================== ---- sope-appserver/mod_ngobjweb/handler.c (révision 1608) +--- sope-appserver/mod_ngobjweb/handler.c (révision 1618) +++ sope-appserver/mod_ngobjweb/handler.c (copie de travail) @@ -267,7 +267,7 @@ const char *uri; @@ -1658,7 +1658,7 @@ Index: sope-appserver/mod_ngobjweb/handler.c static void test(void) { Index: sope-appserver/NGObjWeb/GNUmakefile.postamble =================================================================== ---- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1608) +--- sope-appserver/NGObjWeb/GNUmakefile.postamble (révision 1618) +++ sope-appserver/NGObjWeb/GNUmakefile.postamble (copie de travail) @@ -23,14 +23,20 @@ @@ -1690,7 +1690,7 @@ Index: sope-appserver/NGObjWeb/GNUmakefile.postamble + $(DESTDIR)/$(GNUSTEP_MAKEFILES)/wobundle.make Index: sope-appserver/NGObjWeb/WOContext.m =================================================================== ---- sope-appserver/NGObjWeb/WOContext.m (révision 1608) +--- sope-appserver/NGObjWeb/WOContext.m (révision 1618) +++ sope-appserver/NGObjWeb/WOContext.m (copie de travail) @@ -64,11 +64,13 @@ static BOOL testNSURLs = NO; @@ -1730,28 +1730,35 @@ Index: sope-appserver/NGObjWeb/WOContext.m serverURL = [@"http://" stringByAppendingString:host]; Index: sope-appserver/NGObjWeb/DAVPropMap.plist =================================================================== ---- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1608) +--- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1618) +++ sope-appserver/NGObjWeb/DAVPropMap.plist (copie de travail) -@@ -123,11 +123,14 @@ +@@ -120,17 +120,21 @@ + "{http://ucb.openoffice.org/dav/props/}IsRemoveable" = isOOoRemoveable; + "{http://ucb.openoffice.org/dav/props/}IsVolume" = isOOoVolume; + "{http://ucb.openoffice.org/dav/props/}TargetURL" = davOOoTargetURL; +- ++ + /* WebDAV ACL */ + "{DAV:}current-user-privilege-set" = davCurrentUserPrivilegeSet; /* CalDAV */ ++ "{urn:ietf:params:xml:ns:caldav}calendar-data" = davCalendarData; ++ "{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription; "{urn:ietf:params:xml:ns:caldav}calendar-home-set" = davCalendarHomeSet; + "{urn:ietf:params:xml:ns:caldav}calendar-user-address-set" = davCalendarUserAddressSet; + "{urn:ietf:params:xml:ns:caldav}schedule-inbox-URL" = davCalendarScheduleInboxURL; + "{urn:ietf:params:xml:ns:caldav}schedule-outbox-URL" = davCalendarScheduleOutboxURL; - - /* Apple CalServer */ -- "{http://apple.com/ns/calendarserver/}dropbox-home-URL" = -+ "{http://calendarserver.org/ns/}dropbox-home-URL" = - davDropboxHomeURL; -- "{http://apple.com/ns/calendarserver/}notifications-URL" = -+ "{http://calendarserver.org/ns/}notifications-URL" = - davNotificationsURL; - "{com.apple.ical:}calendarcolor" = davCalendarColor; - } + "{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set" = + davCalendarComponentSet; + "{urn:ietf:params:xml:ns:caldav}supported-calendar-data" = + davSupportedCalendarDataTypes; +- "{urn:ietf:params:xml:ns:caldav}calendar-description" = davDescription; + + /* CardDAV */ + "{urn:ietf:params:xml:ns:carddav}supported-address-data" = Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m =================================================================== ---- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (révision 1608) +--- sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (révision 1618) +++ sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m (copie de travail) @@ -655,6 +655,7 @@ if (self->responses == nil) @@ -1763,7 +1770,7 @@ Index: sope-appserver/NGObjWeb/WebDAV/SaxDAVHandler.m case 'n': Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1608) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (révision 1618) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m (copie de travail) @@ -216,6 +216,12 @@ assocCount++; @@ -1780,7 +1787,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.m Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1608) +--- sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (révision 1618) +++ sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m (copie de travail) @@ -41,6 +41,7 @@ WOAssociation *string; @@ -1813,7 +1820,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/_WOComplexHyperlink.m return NO; Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h =================================================================== ---- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1608) +--- sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (révision 1618) +++ sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h (copie de travail) @@ -41,7 +41,8 @@ WOAssociation *pageName; @@ -1827,7 +1834,7 @@ Index: sope-appserver/NGObjWeb/DynamicElements/WOHyperlinkInfo.h /* 'ivar' associations */ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m =================================================================== ---- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1608) +--- sope-appserver/NGObjWeb/SoObjects/SoObject.m (révision 1618) +++ sope-appserver/NGObjWeb/SoObjects/SoObject.m (copie de travail) @@ -39,22 +39,34 @@ static int debugLookup = -1; @@ -1978,9 +1985,9 @@ Index: sope-appserver/NGObjWeb/SoObjects/SoObject.m Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m =================================================================== ---- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1608) +--- sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (révision 1618) +++ sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m (copie de travail) -@@ -31,6 +31,7 @@ +@@ -32,6 +32,7 @@ #include #include #include @@ -1988,7 +1995,7 @@ Index: sope-appserver/NGObjWeb/WOHttpAdaptor/WOHttpTransaction.m #include "common.h" #include -@@ -1016,6 +1017,12 @@ +@@ -1042,6 +1043,12 @@ - (void)parser:(NGMimePartParser *)_parser didParseHeader:(NGHashMap *)_header { } diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 6491a353..2e81c029 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -21,6 +21,7 @@ #import #import +#import #import #import @@ -150,43 +151,213 @@ static NSNumber *sharedYes = nil; /* name lookup */ -- (void) appendObject: (NSDictionary *) object - withBaseURL: (NSString *) baseURL - toREPORTResponse: (WOResponse *) r +- (void) _appendPropstat: (NSDictionary *) propstat + toResponse: (WOResponse *) r +{ + NSArray *properties; + unsigned int count, max; + + [r appendContentString: @""]; + [r appendContentString: @""]; + properties = [propstat objectForKey: @"properties"]; + max = [properties count]; + for (count = 0; count < max; count++) + [r appendContentString: [properties objectAtIndex: count]]; + [r appendContentString: @""]; + [r appendContentString: @""]; + [r appendContentString: [propstat objectForKey: @"status"]]; + [r appendContentString: @""]; + [r appendContentString: @""]; +} + +#warning we should use the EOFetchSpecification for that!!! (see doPROPFIND:) + +#warning components in calendar-data query are ignored +- (NSString *) _property: (NSObject *) property + ofObject: (SOGoObject *) sogoObject +{ + NSDictionary *map; + NSString *value, *propName, *methodName; + SEL methodSel; + + value = nil; + + propName = [NSString stringWithFormat: @"{%@}%@", + [property namespaceURI], + [property nodeName]]; + map = [[self class] defaultWebDAVAttributeMap]; + methodName = [map objectForKey: propName]; + if (methodName) + { + methodSel = NSSelectorFromString(methodName); + if ([sogoObject respondsToSelector: methodSel]) + { + value = [[sogoObject performSelector: methodSel] + stringByEscapingXMLString]; + if (![value length]) + NSLog (@"value empty?"); + } + } + + return value; +} + +- (NSString *) _namespaceRep: (NSString *) namespace +{ + NSString *rep; + + if ([namespace isEqualToString: @"urn:ietf:params:xml:ns:caldav"]) + rep = @"C"; + else + rep = @"D"; + + return rep; +} + +- (NSString *) _nodeTag: (NSObject *) property +{ + NSMutableString *nodeTag; + NSString *nsRep; + + nodeTag = [NSMutableString string]; + nsRep = [self _namespaceRep: [property namespaceURI]]; + if (nsRep) + [nodeTag appendFormat: @"%@:", nsRep]; + [nodeTag appendString: [property nodeName]]; + + return nodeTag; +} + +- (NSString *) _representProperty: (NSDictionary *) property +{ + NSMutableString *propertyValue; + NSString *content, *nodeTag; + + propertyValue = [NSMutableString string]; + nodeTag = [self _nodeTag: [property objectForKey: @"property"]]; + content = [property objectForKey: @"content"]; + if (content) + [propertyValue appendFormat: @"<%@>%@", nodeTag, content, nodeTag]; + else + [propertyValue appendFormat: @"<%@/>", nodeTag]; + + return propertyValue; +} + +- (NSArray *) _properties: (NSArray *) properties + ofObject: (NSDictionary *) object { - SOGoCalendarComponent *component; - Class componentClass; - NSString *name, *etagLine, *calString; + NSMutableArray *values; + NSEnumerator *list; + NSObject *currentProperty; + NSMutableDictionary *currentValue; + SOGoObject *sogoObject; + NSString *content; + + values = [NSMutableArray array]; + + sogoObject = [self lookupName: [object objectForKey: @"c_name"] + inContext: context + acquire: NO]; + list = [properties objectEnumerator]; + while ((currentProperty = [list nextObject])) + { + currentValue = [NSMutableDictionary dictionary]; + [currentValue setObject: currentProperty + forKey: @"property"]; + content = [self _property: currentProperty + ofObject: sogoObject]; + if (content) + [currentValue setObject: content + forKey: @"content"]; + [values addObject: currentValue]; + } - name = [object objectForKey: @"c_name"]; + return values; +} + +- (NSArray *) _propstats: (NSArray *) properties + ofObject: (NSDictionary *) object +{ + NSMutableArray *propstats, *properties200, *properties404; + NSEnumerator *values; + NSDictionary *currentProperty; + NSString *content, *propertyValue; + + propstats = [NSMutableArray array]; + + properties200 = [NSMutableArray new]; + properties404 = [NSMutableArray new]; + + values = [[self _properties: properties ofObject: object] + objectEnumerator]; + while ((currentProperty = [values nextObject])) + { + content = [currentProperty objectForKey: @"content"]; + propertyValue = [self _representProperty: currentProperty]; + if (content) + [properties200 addObject: propertyValue]; + else + [properties404 addObject: propertyValue]; + } - if ([[object objectForKey: @"c_component"] isEqualToString: @"vevent"]) - componentClass = [SOGoAppointmentObject class]; + if ([properties200 count]) + { + [propstats addObject: [NSDictionary dictionaryWithObjectsAndKeys: + properties200, @"properties", + @"HTTP/1.1 200 OK", @"status", + nil]]; + [properties200 autorelease]; + } + else + [properties200 release]; + + if ([properties404 count]) + { + [propstats addObject: [NSDictionary dictionaryWithObjectsAndKeys: + properties404, @"properties", + @"HTTP/1.1 404 Not Found", @"status", + nil]]; + [properties404 autorelease]; + } else - componentClass = [SOGoTaskObject class]; + [properties404 release]; - component = [componentClass objectWithName: name inContainer: self]; + return propstats; +} + +- (void) appendObject: (NSDictionary *) object + properties: (NSArray *) properties + withBaseURL: (NSString *) baseURL + toComplexResponse: (WOResponse *) r +{ + NSEnumerator *propstats; + NSDictionary *propstat; [r appendContentString: @" \r\n"]; [r appendContentString: @" "]; [r appendContentString: baseURL]; if (![baseURL hasSuffix: @"/"]) [r appendContentString: @"/"]; - [r appendContentString: name]; + [r appendContentString: [object objectForKey: @"c_name"]]; [r appendContentString: @"\r\n"]; - [r appendContentString: @" \r\n"]; - [r appendContentString: @" \r\n"]; - etagLine = [NSString stringWithFormat: @" %@\r\n", - [component davEntityTag]]; - [r appendContentString: etagLine]; - [r appendContentString: @" \r\n"]; - [r appendContentString: @" HTTP/1.1 200 OK\r\n"]; - [r appendContentString: @" \r\n"]; - [r appendContentString: @" "]; - calString = [[component contentAsString] stringByEscapingXMLString]; - [r appendContentString: calString]; - [r appendContentString: @"\r\n"]; + propstats = [[self _propstats: properties ofObject: object] + objectEnumerator]; + while ((propstat = [propstats nextObject])) + [self _appendPropstat: propstat toResponse: r]; + + [r appendContentString: @" \r\n"]; +} + +- (void) appendMissingObjectRef: (NSString *) href + toComplexResponse: (WOResponse *) r +{ + [r appendContentString: @" \r\n"]; + [r appendContentString: @" "]; + [r appendContentString: href]; + [r appendContentString: @"\r\n"]; + [r appendContentString: @" HTTP/1.1 404 Not Found\r\n"]; [r appendContentString: @" \r\n"]; } @@ -204,11 +375,11 @@ static NSNumber *sharedYes = nil; - (NSDictionary *) _parseCalendarFilter: (id ) filterElement { NSMutableDictionary *filterData; - id parentNode; + id parentNode; id ranges; NSString *componentName; - parentNode = [filterElement parentNode]; + parentNode = (id ) [filterElement parentNode]; if ([[parentNode tagName] isEqualToString: @"comp-filter"] && [[parentNode attribute: @"name"] isEqualToString: @"VCALENDAR"]) { @@ -217,7 +388,7 @@ static NSNumber *sharedYes = nil; [filterData autorelease]; [filterData setObject: componentName forKey: @"name"]; ranges = [filterElement getElementsByTagName: @"time-range"]; - if ([ranges count]) + if ([ranges length]) [self _appendTimeRange: [ranges objectAtIndex: 0] toFilter: filterData]; } @@ -227,30 +398,60 @@ static NSNumber *sharedYes = nil; return filterData; } +- (NSArray *) _parseRequestedProperties: (id ) parentNode +{ + NSMutableArray *properties; + NSObject *propList, *children; + NSObject *currentChild; + unsigned int count, max, count2, max2; + + properties = [NSMutableArray array]; + + propList = [parentNode getElementsByTagName: @"prop"]; + max = [propList length]; + for (count = 0; count < max; count++) + { + children = [[propList objectAtIndex: count] childNodes]; + max2 = [children length]; + for (count2 = 0; count2 < max2; count2++) + { + currentChild = [children objectAtIndex: count2]; + if ([currentChild conformsToProtocol: @protocol(DOMElement)]) + [properties addObject: currentChild]; + } + +// while ([children hasChildNodes]) +// [properties addObject: [children next]]; + } + + return properties; +} + - (NSArray *) _parseCalendarFilters: (id ) parentNode { - NSEnumerator *children; - id node; + id children; + id node; NSMutableArray *filters; NSDictionary *filter; + unsigned int count, max; filters = [NSMutableArray array]; - children = [[parentNode getElementsByTagName: @"comp-filter"] - objectEnumerator]; - node = [children nextObject]; - while (node) + children = [parentNode getElementsByTagName: @"comp-filter"]; + max = [children length]; + for (count = 0; count < max; count++) { + node = [children objectAtIndex: count]; filter = [self _parseCalendarFilter: node]; if (filter) - [filters addObject: filter]; - node = [children nextObject]; + [filters addObject: filter]; } return filters; } -- (void) _appendComponentsMatchingFilters: (NSArray *) filters - toResponse: (WOResponse *) response +- (void) _appendComponentProperties: (NSArray *) properties + matchingFilters: (NSArray *) filters + toResponse: (WOResponse *) response { NSArray *apts; unsigned int count, max; @@ -273,13 +474,75 @@ static NSNumber *sharedYes = nil; while (appointment) { [self appendObject: appointment + properties: properties withBaseURL: baseURL - toREPORTResponse: response]; + toComplexResponse: response]; appointment = [appointments nextObject]; } } } +#warning this is baddddd because we return a single-valued dictionary containing \ + a cname which may not event exist... the logic behind appendObject:... should be \ + rethought, especially since we may start using SQL views + +- (NSDictionary *) _componentMatchingURL: (NSString *) url + inBaseURL: (NSString *) baseURL +{ + NSDictionary *component; + NSURL *componentURL, *realBaseURL; + NSArray *urlComponents; + NSString *componentURLPath, *cName; + + component = nil; + + realBaseURL = [NSURL URLWithString: baseURL]; + componentURL = [[NSURL URLWithString: url + relativeToURL: realBaseURL] + standardizedURL]; + componentURLPath = [componentURL absoluteString]; + if ([componentURLPath rangeOfString: [realBaseURL absoluteString]].location + != NSNotFound) + { + urlComponents = [componentURLPath componentsSeparatedByString: @"/"]; + cName = [urlComponents objectAtIndex: [urlComponents count] - 1]; + if ([cName isEqualToString: @"2AAC-4E8AB421-1-B767AA80"]) + NSLog (@"breakpoint..."); + component = [NSDictionary dictionaryWithObject: cName forKey: @"c_name"]; + } + + return component; +} + +- (void) _appendComponentProperties: (NSArray *) properties + matchingURLs: (id ) refs + toResponse: (WOResponse *) response +{ + NSObject *element; + NSDictionary *currentComponent; + NSString *baseURL, *currentURL; + unsigned int count, max; + + baseURL = [self baseURLInContext: context]; + + max = [refs length]; + for (count = 0; count < max; count++) + { + element = [refs objectAtIndex: count]; + currentURL = [[element firstChild] nodeValue]; + currentComponent = [self _componentMatchingURL: currentURL + inBaseURL: baseURL]; + if (currentComponent) + [self appendObject: currentComponent + properties: properties + withBaseURL: baseURL + toComplexResponse: response]; + else + [self appendMissingObjectRef: currentURL + toComplexResponse: response]; + } +} + - (NSArray *) davNamespaces { NSMutableArray *ns; @@ -293,8 +556,34 @@ static NSNumber *sharedYes = nil; - (id) davCalendarQuery: (id) queryContext { WOResponse *r; - NSArray *filters; id document; + id documentElement; + + r = [context response]; + [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 appendContentString:@"\r\n"]; + [r appendContentString: @"\r\n"]; + + document = [[context request] contentAsDOMDocument]; + documentElement = [document documentElement]; + [self _appendComponentProperties: [self _parseRequestedProperties: documentElement] + matchingFilters: [self _parseCalendarFilters: documentElement] + toResponse: r]; + [r appendContentString:@"\r\n"]; + + return r; +} + +- (id) davCalendarMultiget: (id) queryContext +{ + WOResponse *r; + id document; + id documentElement; r = [context response]; [r setStatus: 207]; @@ -307,8 +596,9 @@ static NSNumber *sharedYes = nil; @" xmlns:C=\"urn:ietf:params:xml:ns:caldav\">\r\n"]; document = [[context request] contentAsDOMDocument]; - filters = [self _parseCalendarFilters: [document documentElement]]; - [self _appendComponentsMatchingFilters: filters + documentElement = [document documentElement]; + [self _appendComponentProperties: [self _parseRequestedProperties: documentElement] + matchingURLs: [documentElement getElementsByTagName: @"href"] toResponse: r]; [r appendContentString:@"\r\n"]; diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 33dd2b6e..1c70f758 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -155,6 +155,11 @@ static BOOL sendEMailNotifications = NO; return secureContent; } +- (NSString *) davCalendarData +{ + return [self contentAsString]; +} + - (iCalCalendar *) calendar: (BOOL) create secure: (BOOL) secure { NSString *componentTag; diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 84d69356..a4e0c227 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -1319,7 +1319,6 @@ static BOOL sendACLAdvisories = NO; r = [queryContext response]; [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"]; @@ -1327,12 +1326,15 @@ static BOOL sendACLAdvisories = NO; content = [self _davAclActionFromQuery: document]; if (content) { - [r setStatus: 207]; if ([content length]) { + [r setStatus: 207]; + [r setHeader: @"text/xml; charset=\"utf-8\"" forKey: @"content-type"]; [r appendContentString: @"\r\n"]; [r appendContentString: content]; } + else + [r setStatus: 204]; } else [r setStatus: 400]; diff --git a/SoObjects/SOGo/SOGoPermissions.h b/SoObjects/SOGo/SOGoPermissions.h index b300a1cc..7fdab2c9 100644 --- a/SoObjects/SOGo/SOGoPermissions.h +++ b/SoObjects/SOGo/SOGoPermissions.h @@ -29,7 +29,6 @@ extern NSString *SOGoRole_ObjectCreator; extern NSString *SOGoRole_ObjectEraser; -extern NSString *SOGoRole_ObjectReader; extern NSString *SOGoRole_ObjectViewer; extern NSString *SOGoRole_ObjectEditor; -- 2.39.5