+2008-05-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * Main/SOGo.m ([SOGo -davURL], [SOGo -soURL]): copied methods from
+ SOGoObject.
+
+ * SoObjects/SOGo/SOGoUserFolder.m ([SOGoUserFolder
+ -davDisplayName]): new overriden method to provide a display name
+ to the users principal.
+
+ * SoObjects/SOGo/SOGoPermissions.[hm]: removed the "Save Acls"
+ permission since its purposes matches SOPE's "Change Permissions".
+
+ * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder
+ +webdavAclManager]): new overriden method.
+
+ * SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder
+ +webdavAclManager]): new overriden method.
+
+ * UI/MailPartViewers/UIxMailPartTextViewer.m (convertChars): do
+ not cast pointers to unsigned int to avoid problems with big
+ endian archs.
+
+ * SoObjects/Contacts/SOGoContactLDAPFolder.m ([-davNamespaces]):
+ removed method.
+
+ * SoObjects/Contacts/SOGoContactGCSFolder.m ([-davNamespaces]):
+ removed method.
+
+ * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder
+ +webdavAclManager]): new overriden method.
+
+ * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder +webdavAclManager]):
+ new overriden method.
+
+ * SoObjects/Appointments/SOGoAppointmentObject.m
+ ([SOGoAppointmentObject +webdavAclManager]): new overriden method.
+
+ * SoObjects/Appointments/SOGoAppointmentFolder.m
+ ([SOGoAppointmentFolder +webdavAclManager]): new overriden method.
+ ([-davNamespaces]): removed method.
+ ([-lookupGroupFolderForUIDs:_uidsinContext:])
+ ([-lookupGroupCalendarFolderForUIDs:_uidsinContext:_ctx]):
+ disabled methods.
+
+ * SoObjects/SOGo/SOGoWebDAVAclManager.[hm]: new class module that
+ implements the rendering of DAV acl trees as well as their mapping
+ from SOGo permissions.
+
+ * SoObjects/SOGo/SOGoObject.m ([SOGoObject +initialize]): libSOGo
+ is now a framework, so we can simplify the loading of the DAVReportMap.
+ ([-lookupGroupsFolder]): disabled method.
+ ([SOGoObject -davOwner], [SOGoObject -davAclRestrictions])
+ ([SOGoObject -davPrincipalCollectionSet])
+ ([SOGoObject -davCurrentUserPrivilegeSet])
+ ([SOGoObject -davSupportedPrivilegeSet], [SOGoObject -davAcl])
+ ([SOGoObject -davPrincipalMatch:localContext])
+ ([SOGoObject -davSupportedReportSet]): (re-)implemented dav
+ methods with our new dav rendering paradigm.
+ ([-davNamespaces]): removed method.
+ ([SOGoObject -domNode:nodegetChildNodesByType:type]): new helper
+ method to help subclass with parsing dav requests, especially wrt
+ REPORT ones.
+ ([SOGoObject +webdavAclManager]): new overridable method that
+ returns a properly configured DAV acl manager (see above).
+
+ * SoObjects/Appointments/SOGoUserFolder+Appointments.[hm]: new
+ category module that implements DAV methods required by CalDAV.
+
+ * UI/SOGoUI/UIxComponent.m ([UIxComponent -applicationPath]):
+ disabled all mentions of "SOGoGroupFolder*".
+
+ * SoObjects/SOGo/SOGoDAVRendererTypes.[hm]: removed subclass
+ module, superseded by the new method mentionned below.
+
+ * SoObjects/SOGo/SOGoWebDAVValue.m ([SOGoWebDAVValue
+ -stringForTag:_keyrawName:setTaginContext:contextprefixes:prefixes]):
+ a simple wrapper that returns an uninterpreted NSString to SOPE.
+
+ * SoObjects/SOGo/NSArray+DAV.[hm],
+ * SoObjects/SOGo/NSDictionary+DAV.[hm],
+ * SoObjects/SOGo/NSObject+DAV.[hm],
+ * SoObjects/SOGo/NSString+DAV.[hm],
+ * SoObjects/SOGo/NSURL+DAV.[hm]: new class category modules that
+ handle the correct generation of DAV entries, with namespace
+ accounting. Those were implemented to enable the use of a simple
+ SoWebDAVValue as the root of the resulting string, thereby
+ avoiding the xml escaping done by SOPE when returning a real NSString.
+
+2008-04-25 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/SOGo/LDAPSource.m ([LDAPSource -fetchContactsMatching:match])
+ ([LDAPSource -lookupContactEntryWithUIDorEmail:uid]): take all the
+ mail fields into account when doing a search.
+
2008-04-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoObject.m ([SOGoObject +initialize]): the
#import <NGExtensions/NSObject+Logs.h>
#import <NGExtensions/NSProcessInfo+misc.h>
#import <NGExtensions/NSString+Encoding.h>
+#import <NGExtensions/NSString+misc.h>
#import <WEExtensions/WEResourceManager.h>
return locale;
}
+- (NSURL *) _urlPreferringParticle: (NSString *) expected
+ overThisOne: (NSString *) possible
+{
+ NSURL *serverURL, *url;
+ NSMutableArray *path;
+ NSString *baseURL, *urlMethod;
+ WOContext *context;
+
+ context = [self context];
+ serverURL = [context serverURL];
+ baseURL = [[self baseURLInContext: context] stringByUnescapingURL];
+ path = [NSMutableArray arrayWithArray: [baseURL componentsSeparatedByString:
+ @"/"]];
+ if ([baseURL hasPrefix: @"http"])
+ {
+ [path removeObjectAtIndex: 1];
+ [path removeObjectAtIndex: 0];
+ [path replaceObjectAtIndex: 0 withObject: @""];
+ }
+ urlMethod = [path objectAtIndex: 2];
+ if (![urlMethod isEqualToString: expected])
+ {
+ if ([urlMethod isEqualToString: possible])
+ [path replaceObjectAtIndex: 2 withObject: expected];
+ else
+ [path insertObject: expected atIndex: 2];
+ }
+
+ url = [[NSURL alloc] initWithScheme: [serverURL scheme]
+ host: [serverURL host]
+ path: [path componentsJoinedByString: @"/"]];
+ [url autorelease];
+
+ return url;
+}
+
+- (NSURL *) davURL
+{
+ return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
+}
+
+- (NSURL *) soURL
+{
+ return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
+}
+
/* name (used by the WEResourceManager) */
- (NSString *) name
-Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
-===================================================================
---- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1620)
-+++ 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 1620)
-+++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail)
-@@ -30,6 +30,7 @@
-
- #import <NGExtensions/NSObject+Logs.h>
-
-+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 1620)
-+++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail)
-@@ -31,6 +31,8 @@
- #import <Foundation/Foundation.h>
- #import <GDLAccess/EOSQLExpression.h>
-
-+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 1620)
}
return data;
}
+Index: sope-gdl1/PostgreSQL/PostgreSQL72Channel.m
+===================================================================
+--- sope-gdl1/PostgreSQL/PostgreSQL72Channel.m (révision 1620)
++++ 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 1620)
++++ sope-gdl1/Oracle8/OracleAdaptorChannel.m (copie de travail)
+@@ -30,6 +30,7 @@
+
+ #import <NGExtensions/NSObject+Logs.h>
+
++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 1620)
++++ sope-gdl1/Oracle8/OracleAdaptorChannelController.m (copie de travail)
+@@ -31,6 +31,8 @@
+ #import <Foundation/Foundation.h>
+ #import <GDLAccess/EOSQLExpression.h>
+
++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/NGExtensions/NSString+Ext.h
===================================================================
--- sope-core/NGExtensions/NGExtensions/NSString+Ext.h (révision 1620)
===================================================================
--- sope-appserver/NGObjWeb/DAVPropMap.plist (révision 1620)
+++ sope-appserver/NGObjWeb/DAVPropMap.plist (copie de travail)
-@@ -24,6 +24,13 @@
+@@ -24,13 +24,19 @@
"{DAV:}status" = "davStatus";
"{http://apache.org/dav/props/}executable" = "davIsExecutable";
/* used with Apple WebDAV */
"{DAV:}quota" = davQuota;
"{DAV:}quotaused" = davQuotaUsed;
-@@ -120,17 +127,21 @@
+ "{http://www.apple.com/webdav_fs/props/}appledoubleheader"=appleDoubleHeader;
+
+ /* Novell NetDrive */
+- "{DAV:}owner" = davOwner;
+ "{DAV:}locktoken" = davLockToken;
+ "{DAV:}activelock" = davActiveLock;
+ // TODO: non-standard?, also used by WebDrive
+@@ -120,17 +126,32 @@
"{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:}owner" = davOwner;
++ "{DAV:}group" = davGroup;
++ "{DAV:}supported-privilege-set" = davSupportedPrivilegeSet;
++ "{DAV:}principal-collection-set" = davPrincipalCollectionSet;
++ "{DAV:}acl" = davAcl;
++ "{DAV:}acl-restrictions" = davAclRestrictions;
"{DAV:}current-user-privilege-set" = davCurrentUserPrivilegeSet;
++ "{DAV:}inherited-acl-set" = davInheritedAclSet;
++ "{DAV:}principal-URL" = davPrincipalURL;
++ "{DAV:}alternate-URI-set" = davAlternateURISet;
++ "{DAV:}group-member-set" = davGroupMemberSet;
++ "{DAV:}group-membership" = davGroupMembership;
/* CalDAV */
+ "{urn:ietf:params:xml:ns:caldav}calendar-data" = davCalendarData;
/* CardDAV */
"{urn:ietf:params:xml:ns:carddav}supported-address-data" =
-@@ -138,13 +149,13 @@
+@@ -138,13 +159,13 @@
"{urn:ietf:params:xml:ns:carddav}addressbook-description" = davDescription;
/* Apple CalServer */
Appointments_PRINCIPAL_CLASS = SOGoAppointmentsProduct
+# SOGoGroupAppointmentFolder.m
Appointments_OBJC_FILES = \
Product.m \
NSArray+Appointments.m \
SOGoTaskObject.m \
SOGoAppointmentFolder.m \
SOGoAppointmentFolders.m \
- SOGoGroupAppointmentFolder.m \
SOGoFreeBusyObject.m \
+ SOGoUserFolder+Appointments.m \
\
SOGoAptMailNotification.m \
SOGoAptMailInvitation.m \
- (NSArray *) lookupCalendarFoldersForICalPerson: (NSArray *) _persons
inContext: (id) _ctx;
-- (id) lookupGroupFolderForUIDs: (NSArray *) _uids
- inContext: (id) _ctx;
-- (id) lookupGroupCalendarFolderForUIDs: (NSArray *) _uids
- inContext: (id) _ctx;
+// - (id) lookupGroupFolderForUIDs: (NSArray *) _uids
+// inContext: (id) _ctx;
+// - (id) lookupGroupCalendarFolderForUIDs: (NSArray *) _uids
+// inContext: (id) _ctx;
/* bulk fetches */
#import <SaxObjC/XMLNamespaces.h>
// #import <NGObjWeb/SoClassSecurityInfo.h>
+#import <SOGo/NSArray+Utilities.h>
+#import <SOGo/NSObject+DAV.h>
+#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoCache.h>
-#import <SOGo/SOGoCustomGroupFolder.h>
+// #import <SOGo/SOGoCustomGroupFolder.h>
#import <SOGo/LDAPUserManager.h>
#import <SOGo/SOGoPermissions.h>
-#import <SOGo/NSArray+Utilities.h>
-#import <SOGo/NSString+Utilities.h>
#import <SOGo/SOGoUser.h>
+#import <SOGo/SOGoWebDAVAclManager.h>
#import "SOGoAppointmentObject.h"
#import "SOGoAppointmentFolders.h"
sharedYes = [[NSNumber numberWithBool: YES] retain];
}
++ (SOGoWebDAVAclManager *) webdavAclManager
+{
+ SOGoWebDAVAclManager *webdavAclManager = nil;
+ NSString *nsCD, *nsD, *nsI;
+
+ if (!webdavAclManager)
+ {
+ nsD = @"DAV:";
+ nsCD = @"urn:ietf:params:xml:ns:caldav";
+ nsI = @"urn:inverse:params:xml:ns:inverse-dav";
+
+ webdavAclManager = [SOGoWebDAVAclManager new];
+ [webdavAclManager registerDAVPermission: davElement (@"read", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"read", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"read-free-busy", nsD)
+ abstract: NO
+ withEquivalent: SoPerm_AccessContentsInformation
+ asChildOf: davElement (@"read", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"write", nsD)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"bind", nsD)
+ abstract: NO
+ withEquivalent: SoPerm_AddDocumentsImagesAndFiles
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"schedule",
+ nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"bind", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"schedule-post",
+ nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-post-vevent", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-post", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-post-vtodo", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-post", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-post-vjournal", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-post", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-post-vfreebusy", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-post", nsCD)];
+ [webdavAclManager registerDAVPermission: davElement (@"schedule-deliver",
+ nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-deliver-vevent", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-deliver", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-deliver-vtodo", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-deliver", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-deliver-vjournal", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-deliver", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-deliver-vfreebusy", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-deliver", nsCD)];
+ [webdavAclManager registerDAVPermission: davElement (@"schedule-respond",
+ nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-respond-vevent", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-respond", nsCD)];
+ [webdavAclManager registerDAVPermission:
+ davElement (@"schedule-respond-vtodo", nsCD)
+ abstract: NO
+ withEquivalent: nil
+ asChildOf: davElement (@"schedule-respond", nsCD)];
+ [webdavAclManager registerDAVPermission: davElement (@"unbind", nsD)
+ abstract: NO
+ withEquivalent: SoPerm_DeleteObjects
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-properties", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_ChangePermissions /* hackish */
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-content", nsD)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"admin", nsI)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"read-acl", nsD)
+ abstract: YES
+ withEquivalent: SOGoPerm_ReadAcls
+ asChildOf: davElement (@"admin", nsI)];
+ [webdavAclManager registerDAVPermission: davElement (@"write-acl", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_ChangePermissions
+ asChildOf: davElement (@"admin", nsI)];
+ }
+
+ return webdavAclManager;
+}
+
- (id) initWithName: (NSString *) name
inContainer: (id) newContainer
{
}
}
-- (NSArray *) davNamespaces
-{
- NSMutableArray *ns;
-
- ns = [NSMutableArray arrayWithArray: [super davNamespaces]];
- [ns addObjectUniquely: @"urn:ietf:params:xml:ns:caldav"];
-
- return ns;
-}
-
- (NSString *) davCalendarColor
{
NSString *color;
return [self lookupCalendarFoldersForUIDs:uids inContext:_ctx];
}
-- (id) lookupGroupFolderForUIDs: (NSArray *) _uids
- inContext: (id)_ctx
-{
- SOGoCustomGroupFolder *folder;
+// - (id) lookupGroupFolderForUIDs: (NSArray *) _uids
+// inContext: (id)_ctx
+// {
+// SOGoCustomGroupFolder *folder;
- if (_uids == nil)
- return nil;
+// if (_uids == nil)
+// return nil;
- folder = [[SOGoCustomGroupFolder alloc] initWithUIDs:_uids inContainer:self];
- return [folder autorelease];
-}
+// folder = [[SOGoCustomGroupFolder alloc] initWithUIDs:_uids inContainer:self];
+// return [folder autorelease];
+// }
-- (id) lookupGroupCalendarFolderForUIDs: (NSArray *) _uids
- inContext: (id) _ctx
-{
- SOGoCustomGroupFolder *folder;
+// - (id) lookupGroupCalendarFolderForUIDs: (NSArray *) _uids
+// inContext: (id) _ctx
+// {
+// SOGoCustomGroupFolder *folder;
- if ((folder = [self lookupGroupFolderForUIDs:_uids inContext:_ctx]) == nil)
- return nil;
+// if ((folder = [self lookupGroupFolderForUIDs:_uids inContext:_ctx]) == nil)
+// return nil;
- folder = [folder lookupName:@"Calendar" inContext:_ctx acquire:NO];
- if (![folder isNotNull])
- return nil;
- if ([folder isKindOfClass:[NSException class]]) {
- [self debugWithFormat:@"Note: could not lookup 'Calendar' in folder: %@",
- folder];
- return nil;
- }
+// folder = [folder lookupName:@"Calendar" inContext:_ctx acquire:NO];
+// if (![folder isNotNull])
+// return nil;
+// if ([folder isKindOfClass:[NSException class]]) {
+// [self debugWithFormat:@"Note: could not lookup 'Calendar' in folder: %@",
+// folder];
+// return nil;
+// }
- return folder;
-}
+// return folder;
+// }
/* bulk fetches */
#import <SoObjects/SOGo/iCalEntityObject+Utilities.h>
#import <SoObjects/SOGo/LDAPUserManager.h>
#import <SoObjects/SOGo/NSArray+Utilities.h>
+#import <SoObjects/SOGo/NSObject+DAV.h>
#import <SoObjects/SOGo/SOGoObject.h>
#import <SoObjects/SOGo/SOGoPermissions.h>
#import <SoObjects/SOGo/SOGoUser.h>
+#import <SoObjects/SOGo/SOGoWebDAVAclManager.h>
+#import <SoObjects/SOGo/SOGoWebDAVValue.h>
#import <SoObjects/SOGo/WORequest+SOGo.h>
#import "NSArray+Appointments.h"
@implementation SOGoAppointmentObject
++ (SOGoWebDAVAclManager *) webdavAclManager
+{
+ SOGoWebDAVAclManager *webdavAclManager = nil;
+ NSString *nsD, *nsI;
+
+ if (!webdavAclManager)
+ {
+ nsD = @"DAV:";
+ nsI = @"urn:inverse:params:xml:ns:inverse-dav";
+
+// extern NSString *SOGoCalendarPerm_ViewAllComponent;
+// extern NSString *SOGoCalendarPerm_ViewDAndT;
+// extern NSString *SOGoCalendarPerm_ModifyComponent;
+// extern NSString *SOGoCalendarPerm_RespondToComponent;
+
+ webdavAclManager = [SOGoWebDAVAclManager new];
+ [webdavAclManager registerDAVPermission: davElement (@"read", nsD)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"read", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"view-whole-component", nsI)
+ abstract: NO
+ withEquivalent: SOGoCalendarPerm_ViewAllComponent
+ asChildOf: davElement (@"read", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"view-date-and-time", nsI)
+ abstract: NO
+ withEquivalent: SOGoCalendarPerm_ViewDAndT
+ asChildOf: davElement (@"view-whole-component", nsI)];
+ [webdavAclManager registerDAVPermission: davElement (@"write", nsD)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-properties", nsD)
+ abstract: YES
+ withEquivalent: SoPerm_ChangePermissions /* hackish */
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-content", nsD)
+ abstract: YES
+ withEquivalent: SOGoCalendarPerm_ModifyComponent
+ asChildOf: davElement (@"write", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"respond-to-component", nsI)
+ abstract: YES
+ withEquivalent: SOGoCalendarPerm_RespondToComponent
+ asChildOf: davElement (@"write-content", nsD)];
+ [webdavAclManager registerDAVPermission: davElement (@"admin", nsI)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", nsD)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"read-acl", nsD)
+ abstract: YES
+ withEquivalent: SOGoPerm_ReadAcls
+ asChildOf: davElement (@"admin", nsI)];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-acl", nsD)
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"admin", nsI)];
+ }
+
+ return webdavAclManager;
+}
+
- (NSString *) componentTag
{
return @"vevent";
@implementation SOGoAptMailGermanDeletion
@end
-@interface SOGoAptMailItalinDeletion : SOGoAptMailNotification
+@interface SOGoAptMailItalianDeletion : SOGoAptMailNotification
@end
@implementation SOGoAptMailItalianDeletion
--- /dev/null
+/* SOGoUserFolder+Appointments.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SOGOUSERFOLDER_APPOINTMENTS_H
+#define SOGOUSERFOLDER_APPOINTMENTS_H
+
+@class NSArray;
+
+#import <SOGo/SOGoUserFolder.h>
+
+@interface SOGoUserFolder (SOGoCalDAVSupport)
+
+- (NSArray *) davCalendarUserAddressSet;
+
+// - (NSArray *) davCalendarHomeSet
+// - (NSArray *) davCalendarScheduleInboxURL
+// - (NSString *) davCalendarScheduleOutboxURL
+// - (NSString *) davDropboxHomeURL
+// - (NSString *) davNotificationsURL
+
+@end
+
+#endif /* SOGOUSERFOLDER_APPOINTMENTS_H */
--- /dev/null
+/* SOGoUserFolder+Appointments.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSArray.h>
+#import <NGObjWeb/WOContext+SoObjects.h>
+
+#import <SOGo/SOGoUser.h>
+
+#import "SOGoUserFolder+Appointments.h"
+
+@implementation SOGoUserFolder (SOGoCalDAVSupport)
+
+- (NSArray *) davCalendarUserAddressSet
+{
+ NSArray *tag, *allEmails;
+ NSMutableArray *addresses;
+ NSEnumerator *emails;
+ NSString *currentEmail;
+
+ addresses = [NSMutableArray array];
+
+ allEmails = [[context activeUser] allEmails];
+ emails = [allEmails objectEnumerator];
+ while ((currentEmail = [emails nextObject]))
+ {
+ tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+ [NSString stringWithFormat: @"MAILTO:%@", currentEmail],
+ nil];
+ [addresses addObject: tag];
+ }
+
+ return addresses;
+}
+
+
+// /* CalDAV support */
+// - (NSArray *) davCalendarHomeSet
+// {
+// /*
+// <C:calendar-home-set xmlns:D="DAV:"
+// xmlns:C="urn:ietf:params:xml:ns:caldav">
+// <D:href>http://cal.example.com/home/bernard/calendars/</D:href>
+// </C:calendar-home-set>
+
+// Note: this is the *container* for calendar collections, not the
+// collections itself. So for use its the home folder, the
+// public folder and the groups folder.
+// */
+// NSArray *tag;
+// SOGoAppointmentFolders *parent;
+
+// parent = [self privateCalendars: @"Calendar" inContext: context];
+// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+// [parent davURL], nil];
+
+// return [NSArray arrayWithObject: tag];
+// }
+
+// - (NSArray *) davCalendarScheduleInboxURL
+// {
+// NSArray *tag;
+// SOGoAppointmentFolders *parent;
+
+// parent = [self privateCalendars: @"Calendar" inContext: context];
+// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
+// nil];
+
+// return [NSArray arrayWithObject: tag];
+// }
+
+// - (NSString *) davCalendarScheduleOutboxURL
+// {
+// NSArray *tag;
+// SOGoAppointmentFolders *parent;
+
+// parent = [self privateCalendars: @"Calendar" inContext: context];
+// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
+// nil];
+
+// return [NSArray arrayWithObject: tag];
+// }
+
+// - (NSString *) davDropboxHomeURL
+// {
+// NSArray *tag;
+// SOGoAppointmentFolders *parent;
+
+// parent = [self privateCalendars: @"Calendar" inContext: context];
+// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
+// nil];
+
+// return [NSArray arrayWithObject: tag];
+// }
+
+// - (NSString *) davNotificationsURL
+// {
+// NSArray *tag;
+// SOGoAppointmentFolders *parent;
+
+// parent = [self privateCalendars: @"Calendar" inContext: context];
+// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
+// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
+// nil];
+
+// return [NSArray arrayWithObject: tag];
+// }
+
+@end
"RespondToConfidentialRecords" = ( "Owner", "ConfidentialModifier", "ConfidentialResponder" );
};
};
- SOGoGroupAppointmentFolder = {
- superclass = "SOGoAppointmentFolder";
- };
+// SOGoGroupAppointmentFolder = {
+// superclass = "SOGoAppointmentFolder";
+// };
SOGoCalendarComponent = {
superclass = "SOGoContentObject";
defaultRoles = {
return classes;
}
-- (NSArray *) davNamespaces
-{
- NSMutableArray *ns;
-
- ns = [NSMutableArray arrayWithArray: [super davNamespaces]];
- [ns addObjectUniquely: @"urn:ietf:params:xml:ns:carddav"];
-
- return ns;
-}
-
- (NSString *) groupDavResourceType
{
return @"vcard-collection";
ASSIGN (ldapSource, newLDAPSource);
}
-- (NSArray *) davNamespaces
-{
- return [NSArray arrayWithObject: @"urn:ietf:params:xml:ns:carddav"];
-}
-
- (NSString *) groupDavResourceType
{
return @"vcard-collection";
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "ObjectViewer" );
"ReadAcls" = ( "Owner", "MailAdministrator" );
- "SaveAcls" = ( "Owner", "MailAdministrator" );
+ "Change Permissions" = ( "Owner", "MailAdministrator" );
};
};
/* SOGoSharedInboxFolder = {
"{urn:ietf:params:xml:ns:carddav}supported-collation-set"
= davSupportedCollectionSet;
+ /* WebDAV ACL */
+ "{DAV:}principal-match" = davPrincipalMatch;
+
/* Inverse DAV */
"{urn:inverse:params:xml:ns:inverse-dav}collection-query"
= davCollectionQuery;
SOGo_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
+# SOGoCustomGroupFolder.h \
+# SOGoGroupsFolder.h \
+# SOGoGroupFolder.h
SOGo_HEADER_FILES = \
SOGoCache.h \
SOGoObject.h \
SOGoFolder.h \
SOGoParentFolder.h \
SOGoUserFolder.h \
- SOGoGroupsFolder.h \
- SOGoGroupFolder.h \
- SOGoCustomGroupFolder.h \
\
LDAPUserManager.h \
LDAPSource.h \
SOGoDateFormatter.h \
SOGoPermissions.h \
- SOGoDAVRendererTypes.h \
iCalEntityObject+Utilities.h \
+ NSArray+DAV.h \
NSArray+Utilities.h \
+ NSCalendarDate+SOGo.h \
+ NSDictionary+DAV.h \
NSDictionary+URL.h \
NSDictionary+Utilities.h \
+ NSNull+Utilities.h \
+ NSNumber+Utilities.h \
+ NSObject+DAV.h \
NSObject+Utilities.h \
+ NSString+DAV.h \
NSString+Utilities.h \
- NSNumber+Utilities.h \
- NSNull+Utilities.h \
- NSDictionary+URL.h \
- NSCalendarDate+SOGo.h \
+ NSURL+DAV.h \
\
SOGoDAVAuthenticator.h \
SOGoWebAuthenticator.h \
+ SOGoWebDAVAclManager.h \
+ SOGoWebDAVValue.h \
SOGoMailer.h \
SOGoUser.h \
\
\
WORequest+SOGo.h
+# SOGoCustomGroupFolder.m \
+# SOGoGroupsFolder.m \
+# SOGoGroupFolder.m
SOGo_OBJC_FILES = \
SOGoCache.m \
SOGoObject.m \
SOGoGCSFolder.m \
SOGoParentFolder.m \
SOGoUserFolder.m \
- SOGoGroupsFolder.m \
- SOGoGroupFolder.m \
- SOGoCustomGroupFolder.m \
\
SOGoDateFormatter.m \
SOGoPermissions.m \
LDAPUserManager.m \
LDAPSource.m \
- SOGoDAVRendererTypes.m \
AgenorUserDefaults.m \
iCalEntityObject+Utilities.m \
+ NSArray+DAV.m \
NSArray+Utilities.m \
+ NSCalendarDate+SOGo.m \
+ NSDictionary+DAV.m \
NSDictionary+URL.m \
NSDictionary+Utilities.m \
+ NSNull+Utilities.m \
+ NSNumber+Utilities.m \
+ NSObject+DAV.m \
NSObject+Utilities.m \
+ NSString+DAV.m \
NSString+Utilities.m \
- NSNumber+Utilities.m \
- NSNull+Utilities.m \
- NSCalendarDate+SOGo.m \
+ NSURL+DAV.m \
\
SOGoDAVAuthenticator.m \
SOGoWebAuthenticator.m \
+ SOGoWebDAVAclManager.m \
+ SOGoWebDAVValue.m \
SOGoMailer.m \
SOGoUser.m \
\
SOGo_INCLUDE_DIRS += -I.. -I../.. -DSOGO_MAJOR_VERSION="\"$(MAJOR_VERSION)\"" -DSOGO_MINOR_VERSION="\"$(MINOR_VERSION)\""
SOGo_LIBRARIES_DEPEND_UPON += \
+ -L../../OGoContentStore/$(GNUSTEP_OBJ_DIR)/ \
+ -L../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ \
-lOGoContentStore \
-lGDLAccess \
-lNGObjWeb \
#import "LDAPSource.h"
#import "LDAPUserManager.h"
+#import "NSArray+Utilities.h"
static NSArray *commonSearchFields;
static int timeLimit;
[self _initLDAPConnection];
entries = [ldapConnection deepSearchAtBaseDN: baseDN
- qualifier: [self _qualifierForBindFilter: loginToCheck]
+ qualifier:
+ [self _qualifierForBindFilter: loginToCheck]
attributes: [NSArray arrayWithObject: @"dn"]];
userEntry = [entries nextObject];
if (userEntry)
/* contact management */
- (EOQualifier *) _qualifierForFilter: (NSString *) filter
{
- NSString *qs;
+ NSString *qs, *mailFormat, *fieldFormat;
EOQualifier *qualifier;
+ fieldFormat = [NSString stringWithFormat: @"(%%@='%@*')", filter];
+ mailFormat = [[mailFields stringsWithFormat: fieldFormat]
+ componentsJoinedByString: @" OR "];
+
if ([filter length] > 0)
{
if ([filter isEqualToString: @"."])
@"(cn='%@*')"
@"OR (sn='%@*')"
@"OR (displayName='%@*')"
- @"OR (mail='%@*')"
+ @"OR %@"
@"OR (telephoneNumber='*%@*')",
- filter, filter, filter, filter, filter];
+ filter, filter, filter, mailFormat, filter];
qualifier = [EOQualifier qualifierWithQualifierFormat: qs];
}
else
- (EOQualifier *) _qualifierForUIDFilter: (NSString *) uid
{
- NSString *qs;
+ NSString *qs, *mailFormat, *fieldFormat;
- qs = [NSString stringWithFormat: (@"(%@='%@') OR (mail='%@')"
- @" OR (mozillaSecondEmail='%@')"
- @" OR (xmozillasecondemail='%@')"),
- UIDField, uid, uid, uid, uid];
+ fieldFormat = [NSString stringWithFormat: @"(%%@='%@')", uid];
+ mailFormat = [[mailFields stringsWithFormat: fieldFormat]
+ componentsJoinedByString: @" OR "];
+ qs = [NSString stringWithFormat: (@"(%@='%@') OR %@"),
+ UIDField, uid, mailFormat];
return [EOQualifier qualifierWithQualifierFormat: qs];
}
intoContactEntry: (NSMutableDictionary *) contactEntry
{
NSEnumerator *emailFields;
- NSString *currentFieldName, *value;
+ NSString *currentFieldName;
NSMutableArray *emails;
+ NSArray *allValues;
emails = [NSMutableArray new];
emailFields = [mailFields objectEnumerator];
while ((currentFieldName = [emailFields nextObject]))
{
- value = [[ldapEntry attributeWithName: currentFieldName]
- stringValueAtIndex: 0];
- if (value)
- [emails addObject: value];
+ allValues = [[ldapEntry attributeWithName: currentFieldName]
+ allStringValues];
+ [emails addObjectsFromArray: allValues];
}
- [emails autorelease];
[contactEntry setObject: emails forKey: @"c_emails"];
+ [emails release];
}
- (void) _fillConstraints: (NGLdapEntry *) ldapEntry
contactEntry = [NSMutableDictionary dictionary];
attributes = [[self _searchAttributes] objectEnumerator];
- currentAttribute = [attributes nextObject];
- while (currentAttribute)
+ while ((currentAttribute = [attributes nextObject]))
{
value = [[ldapEntry attributeWithName: currentAttribute]
stringValueAtIndex: 0];
if (value)
[contactEntry setObject: value forKey: currentAttribute];
- currentAttribute = [attributes nextObject];
}
value = [[ldapEntry attributeWithName: IDField] stringValueAtIndex: 0];
if (!value)
forKey: @"MailAccess"];
ldapSources = [sources objectEnumerator];
- currentSource = [ldapSources nextObject];
- while (currentSource)
+ while ((currentSource = [ldapSources nextObject]))
{
userEntry = [currentSource lookupContactEntryWithUIDorEmail: uid];
if (userEntry)
[currentUser setObject: [NSNumber numberWithBool: NO]
forKey: @"MailAccess"];
}
- currentSource = [ldapSources nextObject];
}
if (!cn)
contacts = [NSMutableArray array];
ldapSources = [sources objectEnumerator];
- currentSource = [ldapSources nextObject];
- while (currentSource)
- {
- [contacts addObjectsFromArray:
- [currentSource fetchContactsMatching: filter]];
- currentSource = [ldapSources nextObject];
- }
+ while ((currentSource = [ldapSources nextObject]))
+ [contacts addObjectsFromArray:
+ [currentSource fetchContactsMatching: filter]];
return [self _compactAndCompleteContacts: [contacts objectEnumerator]];
}
--- /dev/null
+/* NSArray+DAV.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSARRAY_DAV_H
+#define NSARRAY_DAV_H
+
+#import <Foundation/NSArray.h>
+
+@class NSMutableDictionary;
+@class NSString;
+
+@interface NSArray (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces;
+
+@end
+
+#endif /* NSARRAY_DAV_H */
--- /dev/null
+/* NSArray+DAV.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import "NSObject+DAV.h"
+
+#import "NSArray+DAV.h"
+
+@implementation NSArray (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces
+{
+ NSMutableString *webdavString;
+ NSEnumerator *children;
+ NSObject *child;
+
+ webdavString = [NSMutableString string];
+ children = [self objectEnumerator];
+ while ((child = [children nextObject]))
+ [webdavString appendString:
+ [child asWebDavStringWithNamespaces: namespaces]];
+
+ return webdavString;
+}
+
+@end
--- /dev/null
+/* NSDictionary+DAV.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSDICTIONARY_DAV_H
+#define NSDICTIONARY_DAV_H
+
+#import <Foundation/NSDictionary.h>
+
+@class NSString;
+
+@interface NSDictionary (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces;
+
+@end
+
+#endif /* NSDICTIONARY_DAV_H */
--- /dev/null
+/* NSDictionary+DAV.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSEnumerator.h>
+#import <Foundation/NSString.h>
+
+#import "NSDictionary+DAV.h"
+
+@implementation NSDictionary (SOGoWebDAVExtensions)
+
+- (NSString *) _namespaceDecl: (NSDictionary *) namespaces
+{
+ NSMutableString *decl;
+ NSEnumerator *keys;
+ NSString *key;
+
+ decl = [NSMutableString string];
+ keys = [[namespaces allKeys] objectEnumerator];
+ while ((key = [keys nextObject]))
+ [decl appendFormat: @" xmlns:%@=\"%@\"",
+ [namespaces objectForKey: key], key];
+
+ return decl;
+}
+
+- (NSString *) _newTagInNamespaces: (NSMutableDictionary *) namespaces
+ forNS: (NSString *) newNS
+{
+ NSString *newTag;
+
+ newTag = [NSString stringWithFormat: @"n%d", [namespaces count]];
+ [namespaces setObject: newTag forKey: newNS];
+
+ return newTag;
+}
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces
+{
+ NSMutableString *webdavString;
+ NSString *nsTag, *ns, *subString, *element;
+ BOOL firstLevel;
+
+ if (!namespaces)
+ {
+ firstLevel = YES;
+ namespaces = [NSMutableDictionary new];
+ [namespaces setObject: @"D" forKey: @"DAV:"];
+ }
+ else
+ firstLevel = NO;
+
+ webdavString = [NSMutableString string];
+ ns = [self objectForKey: @"ns"];
+ nsTag = [namespaces objectForKey: ns];
+ if (!nsTag)
+ nsTag = [self _newTagInNamespaces: namespaces forNS: ns];
+ element = [NSString stringWithFormat: @"%@:%@",
+ nsTag, [self objectForKey: @"method"]];
+ [webdavString appendFormat: @"<%@", element];
+ subString = [[self objectForKey: @"content"]
+ asWebDavStringWithNamespaces: namespaces];
+ if (firstLevel)
+ {
+ [webdavString appendString: [self _namespaceDecl: namespaces]];
+ [namespaces release];
+ }
+ if (subString)
+ [webdavString appendFormat: @">%@</%@>", subString, element];
+ else
+ [webdavString appendString: @"/>"];
+
+ return webdavString;
+}
+
+@end
--- /dev/null
+/* NSObject+DAV.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSOBJECT_DAV_H
+#define NSOBJECT_DAV_H
+
+#import <Foundation/NSObject.h>
+
+@class NSMutableDictionary;
+@class NSString;
+@class SOGoWebDAVValue;
+
+#define davElement(t,n) \
+ [NSDictionary dictionaryWithObjectsAndKeys: t, @"method", n, @"ns", nil]
+
+#define davElementWithContent(t,n,c) \
+ [NSDictionary dictionaryWithObjectsAndKeys: t, @"method", \
+ n, @"ns", \
+ c, @"content", nil]
+
+@interface NSObject (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces;
+- (SOGoWebDAVValue *) asWebDAVValue;
+
+@end
+
+#endif /* NSOBJECT_DAV_H */
--- /dev/null
+/* NSObject+DAV.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import "SOGoWebDAVValue.h"
+
+#import "NSObject+DAV.h"
+
+@implementation NSObject (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces
+{
+ [self subclassResponsibility: _cmd];
+
+ return nil;
+}
+
+- (SOGoWebDAVValue *) asWebDAVValue
+{
+ return [SOGoWebDAVValue
+ valueForObject: [self asWebDavStringWithNamespaces: nil]
+ attributes: nil];
+}
+
+@end
--- /dev/null
+/* NSString+DAV.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSSTRING_DAV_H
+#define NSSTRING_DAV_H
+
+#import <Foundation/NSString.h>
+
+@class NSMutableDictionary;
+
+@interface NSString (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces;
+
+@end
+
+#endif /* NSSTRING_DAV_H */
--- /dev/null
+/* NSString+DAV.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <NGExtensions/NSString+misc.h>
+
+#import "NSString+DAV.h"
+
+@implementation NSString (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces
+{
+ return [self stringByEscapingXMLString];
+}
+
+@end
--- /dev/null
+/* NSURL+DAV.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSURL_DAV_H
+#define NSURL_DAV_H
+
+#import <Foundation/NSURL.h>
+
+@class NSMutableDictionary;
+
+@interface NSURL (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces;
+
+@end
+
+#endif /* NSURL_DAV_H */
--- /dev/null
+/* NSURL+DAV.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <NGExtensions/NSString+misc.h>
+#import <NGExtensions/NSURL+misc.h>
+
+#import "NSURL+DAV.h"
+
+@implementation NSURL (SOGoWebDAVExtensions)
+
+- (NSString *)
+ asWebDavStringWithNamespaces: (NSMutableDictionary *) namespaces
+{
+ return [[self absoluteString] stringByEscapingXMLString];
+}
+
+@end
+++ /dev/null
-/* SOGoDAVRendererTypes.m - this file is part of SOGo
- *
- * Copyright (C) 2006, 2008 Inverse groupe conseil
- *
- * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
- *
- * This file is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This file is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-#import <Foundation/NSArray.h>
-#import <Foundation/NSEnumerator.h>
-#import <Foundation/NSString.h>
-
-#import <NGExtensions/NSString+misc.h>
-
-#import "SOGoDAVRendererTypes.h"
-
-@implementation SOGoDAVSet
-
-+ (id) davSetWithArray: (NSArray *) newValues
- ofValuesTaggedAs: (NSString *) newValueTag
-{
- id davSet;
-
- davSet = [self new];
- [davSet setValueTag: newValueTag];
- [davSet setValues: newValues];
- [davSet autorelease];
-
- return davSet;
-}
-
-- (id) init
-{
- if ((self = [super init]))
- {
- valueTag = nil;
- values = nil;
- }
-
- return self;
-}
-
-- (void) dealloc
-{
- [valueTag release];
- [values release];
- [super dealloc];
-}
-
-- (void) setValueTag: (NSString *) newValueTag
-{
- ASSIGN (valueTag, newValueTag);
-}
-
-- (void) setValues: (NSArray *) newValues
-{
- ASSIGN (values, newValues);
-}
-
-- (NSString *) stringForTag: (NSString *) _key
- rawName: (NSString *) setTag
- inContext: (id) context
- prefixes: (NSDictionary *) prefixes
-{
- NSMutableString *resultString;
- id currentValue;
- NSString *valueString;
- NSEnumerator *valueEnum;
-
- resultString = [NSMutableString new];
- [resultString autorelease];
-
-// [resultString appendFormat: @"<%@>", setTag];
- valueEnum = [values objectEnumerator];
- while ((currentValue = [valueEnum nextObject]))
- {
- if ([currentValue isKindOfClass: [SoWebDAVValue class]])
- valueString
- = [currentValue stringForTag:
- [NSString stringWithFormat: @"{DAV:}%@", valueTag]
- rawName: [NSString stringWithFormat: @"D:%@", valueTag]
- inContext: context
- prefixes: prefixes];
- else
- valueString = [[currentValue description] stringByEscapingXMLString];
-
- [resultString appendFormat: valueString];
-// [resultString appendFormat: @"<%@>%@</%@>",
-// valueTag, valueString, valueTag];
- }
-// [resultString appendFormat: @"</%@>", setTag];
-
- NSLog(@"dav rendering for key '%@' and tag '%@':\n", _key, setTag,
- resultString);
-
- return resultString;
-}
-
-- (NSString *) stringValue
-{
- return [self stringForTag: valueTag rawName: valueTag
- inContext: nil prefixes: nil];
-}
-
-@end
-
-@implementation SOGoDAVDictionary
-
-+ (id) davDictionary: (NSDictionary *) newValues
- taggedAs: (NSString *) newValueTag;
-{
- SOGoDAVDictionary *davDictionary;
-
- davDictionary = [self new];
- [davDictionary setValueTag: newValueTag];
- [davDictionary setValues: newValues];
- [davDictionary autorelease];
-
- return davDictionary;
-}
-
-- (id) init
-{
- if ((self = [super init]))
- {
- valueTag = nil;
- values = nil;
- }
-
- return self;
-}
-
-- (void) dealloc
-{
- [valueTag release];
- [values release];
- [super dealloc];
-}
-
-- (void) setValueTag: (NSString *) newValueTag
-{
- ASSIGN (valueTag, newValueTag);
-}
-
-- (void) setValues: (NSDictionary *) newValues
-{
- ASSIGN (values, newValues);
-}
-
-- (NSString *) stringForTag: (NSString *) _key
- rawName: (NSString *) setTag
- inContext: (id) context
- prefixes: (NSDictionary *) prefixes
-{
- NSMutableString *resultString;
- id currentValue;
- NSEnumerator *objects;
- NSString *currentKey, *valueString;
-
- resultString = [NSMutableString string];
-
- [resultString appendFormat: @"<%@>", valueTag];
- objects = [[values allKeys] objectEnumerator];
- while ((currentKey = [objects nextObject]))
- {
- currentValue = [values objectForKey: currentKey];
- if ([currentValue isKindOfClass: [SoWebDAVValue class]])
- valueString
- = [currentValue stringForTag:
- [NSString stringWithFormat: @"{DAV:}%@", valueTag]
- rawName: [NSString stringWithFormat: @"D:%@", valueTag]
- inContext: context
- prefixes: prefixes];
- else
- valueString = [[currentValue description] stringByEscapingXMLString];
-
- [resultString appendFormat: @"<%@>%@</%@>", currentKey, valueString, currentKey];
- }
- [resultString appendFormat: @"</%@>", valueTag];
-
- return resultString;
-}
-
-@end
#import <SaxObjC/XMLNamespaces.h>
+#import "NSObject+DAV.h"
#import "NSString+Utilities.h"
#import "SOGoPermissions.h"
+#import "SOGoWebDAVAclManager.h"
+
#import "SOGoFolder.h"
+@interface SOGoObject (SOGoDAVHelpers)
+
+- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs;
+
+@end
+
@implementation SOGoFolder
++ (SOGoWebDAVAclManager *) webdavAclManager
+{
+ SOGoWebDAVAclManager *webdavAclManager = nil;
+
+ if (!webdavAclManager)
+ {
+ webdavAclManager = [SOGoWebDAVAclManager new];
+ [webdavAclManager registerDAVPermission: davElement (@"read", @"DAV:")
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"read", @"DAV:")];
+ }
+
+ return webdavAclManager;
+}
+
- (id) init
{
if ((self = [super init]))
return [NSArray array];
}
+- (NSArray *) toManyRelationshipKeys
+{
+ return nil;
+}
+
- (BOOL) isValidContentName: (NSString *) name
{
return ([name length] > 0);
return rType;
}
+/* web dav acl helper */
+- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
+{
+ NSEnumerator *children;
+ NSString *currentKey;
+
+ [super _fillArrayWithPrincipalsOwnedBySelf: hrefs];
+ children = [[self toOneRelationshipKeys] objectEnumerator];
+ while ((currentKey = [children nextObject]))
+ [[self lookupName: currentKey inContext: context
+ acquire: NO] _fillArrayWithPrincipalsOwnedBySelf: hrefs];
+
+ children = [[self toManyRelationshipKeys] objectEnumerator];
+ while ((currentKey = [children nextObject]))
+ [[self lookupName: currentKey inContext: context
+ acquire: NO] _fillArrayWithPrincipalsOwnedBySelf: hrefs];
+}
+
/* folder type */
- (BOOL) isEqual: (id) otherFolder
/* acls */
+- (NSString *) defaultUserID
+{
+ return nil;
+}
+
- (NSArray *) subscriptionRoles
{
return [NSArray arrayWithObjects: SoRole_Owner, SOGoRole_ObjectViewer,
return nil;
}
+- (NSArray *) aclUsers
+{
+ return nil;
+}
+
@end
* Boston, MA 02111-1307, USA.
*/
-#import <NGObjWeb/SoWebDAVValue.h>
-#import "SOGoDAVRendererTypes.h"
-
#import <Foundation/NSArray.h>
#import <Foundation/NSDate.h>
#import <Foundation/NSDictionary.h>
#import "NSDictionary+Utilities.h"
#import "NSArray+Utilities.h"
+#import "NSObject+DAV.h"
#import "NSString+Utilities.h"
#import "SOGoContentObject.h"
#import "SOGoParentFolder.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
+#import "SOGoWebDAVAclManager.h"
#import "WORequest+SOGo.h"
#import "SOGoGCSFolder.h"
@implementation SOGoGCSFolder
++ (SOGoWebDAVAclManager *) webdavAclManager
+{
+ SOGoWebDAVAclManager *webdavAclManager = nil;
+
+ if (!webdavAclManager)
+ {
+ webdavAclManager = [SOGoWebDAVAclManager new];
+ [webdavAclManager registerDAVPermission: davElement (@"read", @"DAV:")
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", @"DAV:")
+ abstract: YES
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"read", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"write", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"bind", @"DAV:")
+ abstract: NO
+ withEquivalent: SoPerm_AddDocumentsImagesAndFiles
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"unbind", @"DAV:")
+ abstract: NO
+ withEquivalent: SoPerm_DeleteObjects
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-properties", @"DAV:")
+ abstract: YES
+ withEquivalent: SoPerm_ChangePermissions /* hackish */
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-content", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"admin", @"urn:inverse:params:xml:ns:inverse-dav")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"read-acl", @"DAV:")
+ abstract: YES
+ withEquivalent: SOGoPerm_ReadAcls
+ asChildOf: davElement (@"admin", @"urn:inverse:params:xml:ns:inverse-dav")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-acl", @"DAV:")
+ abstract: YES
+ withEquivalent: SoPerm_ChangePermissions
+ asChildOf: davElement (@"admin", @"urn:inverse:params:xml:ns:inverse-dav")];
+ }
+
+ return webdavAclManager;
+}
+
+ (void) initialize
{
NSUserDefaults *ud;
}
else
error = [NSException exceptionWithHTTPStatus: 400
- reason: [NSString stringWithFormat:
- @"Empty string"]];
+ reason: @"Empty string"];
}
else
error = [NSException exceptionWithHTTPStatus: 403
#import <Foundation/NSObject.h>
+#import <DOM/DOMProtocols.h>
+
+#if LIB_FOUNDATION_LIBRARY
+#error SOGo will not work properly with libFoundation.
+#error Please use gnustep-base instead.
+#endif
+
+
/*
SOGoObject
@class GCSFolder;
@class SOGoUserFolder;
-@class SOGoGroupsFolder;
-@class SOGoDAVSet;
+@class SOGoWebDAVValue;
+@class SOGoWebDAVAclManager;
#define $(class) NSClassFromString(class)
WOContext *context;
NSString *nameInContainer;
NSString *owner;
+ SOGoWebDAVAclManager *webdavAclManager;
id container;
}
/* looking up shared objects */
- (SOGoUserFolder *) lookupUserFolder;
-- (SOGoGroupsFolder *) lookupGroupsFolder;
- (void) sleep;
- (NSException *)delete;
- (id)GETAction:(id)_ctx;
-- (SOGoDAVSet *) davCurrentUserPrivilegeSet;
-
/* etag support */
- (NSException *) matchesRequestConditionInContext:(id)_ctx;
- (NSString *) httpURLForAdvisoryToUser: (NSString *) uid;
- (NSString *) resourceURLForAdvisoryToUser: (NSString *) uid;
-/* dav */
-- (NSArray *) davNamespaces;
+/* dav acls */
+- (SOGoWebDAVValue *) davCurrentUserPrivilegeSet;
+
+/* inverse dav extensions for acls */
- (NSString *) davRecordForUser: (NSString *) user;
/* description */
@end
+@interface SOGoObject (SOGo)
+
+- (NSString *) contentAsString;
+
+@end
+
+@interface SOGoObject (SOGoDomHelpers)
+
+- (NSArray *) domNode: (id <DOMNode>) node
+ getChildNodesByType: (DOMNodeType) type;
+
+@end
+
#endif /* __SoObjects_SOGoObject_H__ */
-/*
- Copyright (C) 2004-2005 SKYRIX Software AG
-
- This file is part of OpenGroupware.org.
-
- OGo is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the
- Free Software Foundation; either version 2, or (at your option) any
- later version.
-
- OGo is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
- License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with OGo; see the file COPYING. If not, write to the
- Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA.
-*/
-
-#if LIB_FOUNDATION_LIBRARY
-#error SOGo will not work properly with libFoundation.
-#error Please use gnustep-base instead.
-#endif
+/* SOGoGCSFolder.m - this file is part of SOGo
+ *
+ * Copyright (C) 2004-2005 SKYRIX Software AG
+ * Copyright (C) 2006-2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
#import <unistd.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/SoClass.h>
-#import <NGObjWeb/SoClassSecurityInfo.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/SoSelectorInvocation.h>
-#import <NGObjWeb/SoWebDAVValue.h>
#import <NGObjWeb/WEClientCapabilities.h>
#import <NGObjWeb/WOApplication.h>
#import <NGObjWeb/WOContext.h>
#import "NSArray+Utilities.h"
#import "NSCalendarDate+SOGo.h"
#import "NSDictionary+Utilities.h"
+#import "NSObject+DAV.h"
#import "NSObject+Utilities.h"
#import "NSString+Utilities.h"
#import "SOGoCache.h"
-#import "SOGoDAVAuthenticator.h"
-#import "SOGoDAVRendererTypes.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
#import "SOGoUserFolder.h"
+#import "SOGoWebDAVAclManager.h"
+#import "SOGoWebDAVValue.h"
#import "SOGoObject.h"
static NSDictionary *reportMap = nil;
-@interface SOGoObject(Content)
-- (NSString *) contentAsString;
-@end
-
-@interface SoClassSecurityInfo (SOGoAcls)
-
-+ (id) defaultWebDAVPermissionsMap;
-
-- (NSArray *) allPermissions;
-- (NSArray *) allDAVPermissions;
-- (NSArray *) DAVPermissionsForRole: (NSString *) role;
-- (NSArray *) DAVPermissionsForRoles: (NSArray *) roles;
-
-@end
-
-@implementation SoClassSecurityInfo (SOGoAcls)
-
-+ (id) defaultWebDAVPermissionsMap
-{
- return [NSDictionary dictionaryWithObjectsAndKeys:
- @"read", SoPerm_AccessContentsInformation,
- @"bind", SoPerm_AddDocumentsImagesAndFiles,
- @"unbind", SoPerm_DeleteObjects,
- @"write-acl", SoPerm_ChangePermissions,
- @"write-content", SoPerm_ChangeImagesAndFiles,
- @"read-free-busy", SOGoPerm_FreeBusyLookup,
- NULL];
-}
-
-- (NSArray *) allPermissions
-{
- return [defRoles allKeys];
-}
+@implementation SOGoObject
-- (NSArray *) allDAVPermissions
++ (SOGoWebDAVAclManager *) webdavAclManager
{
- NSEnumerator *allPermissions;
- NSMutableArray *davPermissions;
- NSDictionary *davPermissionsMap;
- NSString *sopePermission, *davPermission;
-
- davPermissions = [NSMutableArray array];
-
- davPermissionsMap = [[self class] defaultWebDAVPermissionsMap];
- allPermissions = [[self allPermissions] objectEnumerator];
- sopePermission = [allPermissions nextObject];
- while (sopePermission)
- {
- davPermission = [davPermissionsMap objectForCaseInsensitiveKey: sopePermission];
- if (davPermission && ![davPermissions containsObject: davPermission])
- [davPermissions addObject: davPermission];
- sopePermission = [allPermissions nextObject];
- }
+ SOGoWebDAVAclManager *webdavAclManager = nil;
- return davPermissions;
-}
+ if (!webdavAclManager)
+ webdavAclManager = [SOGoWebDAVAclManager new];
-- (NSArray *) DAVPermissionsForRole: (NSString *) role
-{
- return [self DAVPermissionsForRoles: [NSArray arrayWithObject: role]];
+ return webdavAclManager;
}
-- (NSArray *) DAVPermissionsForRoles: (NSArray *) roles
+/*
++ (id) WebDAVPermissionsMap
{
- NSEnumerator *allPermissions;
- NSMutableArray *davPermissions;
- NSDictionary *davPermissionsMap;
- NSString *sopePermission, *davPermission;
+ static NSDictionary *permissions = nil;
- davPermissions = [NSMutableArray array];
-
- davPermissionsMap = [[self class] defaultWebDAVPermissionsMap];
- allPermissions = [[self allPermissions] objectEnumerator];
- sopePermission = [allPermissions nextObject];
- while (sopePermission)
+ if (!permissions)
{
- if ([[defRoles objectForCaseInsensitiveKey: sopePermission]
- firstObjectCommonWithArray: roles])
- {
- davPermission
- = [davPermissionsMap objectForCaseInsensitiveKey: sopePermission];
- if (davPermission
- && ![davPermissions containsObject: davPermission])
- [davPermissions addObject: davPermission];
- }
- sopePermission = [allPermissions nextObject];
+ permissions = [NSDictionary dictionaryWithObjectsAndKeys:
+ davElement (@"read", @"DAV:"),
+ SoPerm_AccessContentsInformation,
+ davElement (@"bind", @"DAV:"),
+ SoPerm_AddDocumentsImagesAndFiles,
+ davElement (@"unbind", @"DAV:"),
+ SoPerm_DeleteObjects,
+ davElement (@"write-acl", @"DAV:"),
+ SoPerm_ChangePermissions,
+ davElement (@"write-content", @"DAV:"),
+ SoPerm_ChangeImagesAndFiles, NULL];
+ [permissions retain];
}
- return davPermissions;
-}
-
-@end
-
-@implementation SOGoObject
-
-+ (void) _loadReportMap
-{
- NSFileManager *fm;
- NSEnumerator *paths;
- NSString *currentPath, *filename;
-
- [self logWithFormat: @"Loading DAV REPORT map:"];
-
- fm = [NSFileManager defaultManager];
- paths = [NSStandardLibraryPaths() objectEnumerator];
- while (!reportMap && (currentPath = [paths nextObject]))
- {
- filename = [NSString stringWithFormat: @"%@/SOGo-%s.%s/SOGo.framework"
- @"/Resources/DAVReportMap.plist",
- currentPath,
- SOGO_MAJOR_VERSION, SOGO_MINOR_VERSION];
- [self logWithFormat: @" %@", filename];
- if ([fm fileExistsAtPath: filename])
- {
- reportMap = [[NSDictionary alloc] initWithContentsOfFile: filename];
- [self logWithFormat: @"found!"];
- }
- }
-}
+ return permissions;
+ } */
+ (void) initialize
{
NSUserDefaults *ud;
+ NSString *filename;
+ NSBundle *bundle;
ud = [NSUserDefaults standardUserDefaults];
kontactGroupDAV = ![ud boolForKey:@"SOGoDisableKontact34GroupDAVHack"];
sendACLAdvisories = [ud boolForKey: @"SOGoACLsSendEMailNotifications"];
if (!reportMap)
- [self _loadReportMap];
+ {
+ bundle = [NSBundle bundleForClass: self];
+ filename = [bundle pathForResource: @"DAVReportMap" ofType: @"plist"];
+ if (filename
+ && [[NSFileManager defaultManager] fileExistsAtPath: filename])
+ reportMap = [[NSDictionary alloc] initWithContentsOfFile: filename];
+ else
+ [self logWithFormat: @"DAV REPORT map not found!"];
+ }
// SoClass security declarations
// require View permission to access the root (bound to authenticated ...)
return [[self class] globallyUniqueObjectId];
}
-+ (void) _fillDictionary: (NSMutableDictionary *) dictionary
- withDAVMethods: (NSString *) firstMethod, ...
-{
- va_list ap;
- NSString *aclMethodName;
- NSString *methodName;
- SEL methodSel;
-
- va_start (ap, firstMethod);
- aclMethodName = firstMethod;
- while (aclMethodName)
- {
- methodName = [aclMethodName davMethodToObjC];
- methodSel = NSSelectorFromString (methodName);
- if (methodSel && [self instancesRespondToSelector: methodSel])
- [dictionary setObject: methodName
- forKey: [NSString stringWithFormat: @"{DAV:}%@",
- aclMethodName]];
- else
- NSLog(@"************ method '%@' is still unimplemented!",
- methodName);
- aclMethodName = va_arg (ap, NSString *);
- }
-
- va_end (ap);
-}
-
-+ (NSDictionary *) defaultWebDAVAttributeMap
-{
- static NSMutableDictionary *map = nil;
-
- if (!map)
- {
- map = [NSMutableDictionary
- dictionaryWithDictionary: [super defaultWebDAVAttributeMap]];
- [map retain];
- [self _fillDictionary: map
- withDAVMethods: @"owner", @"group", @"supported-privilege-set",
- @"current-user-privilege-set", @"acl", @"acl-restrictions",
- @"inherited-acl-set", @"principal-collection-set", nil];
- }
-
- return map;
-}
-
/* containment */
+ (id) objectWithName: (NSString *)_name inContainer:(id)_container
return object;
}
-/* DAV ACL properties */
-- (NSString *) davOwner
-{
- return [NSString stringWithFormat: @"%@%@",
- [WOApplication davURL],
- [self ownerInContext: nil]];
-}
-
-- (NSString *) davAclRestrictions
-{
- NSMutableString *restrictions;
-
- restrictions = [NSMutableString string];
- [restrictions appendString: @"<D:grant-only/>"];
- [restrictions appendString: @"<D:no-invert/>"];
-
- return restrictions;
-}
-
-- (SOGoDAVSet *) davPrincipalCollectionSet
-{
- NSString *usersUrl;
-
- usersUrl = [NSString stringWithFormat: @"%@users",
- [self rootURLInContext: context]];
-
- return [SOGoDAVSet davSetWithArray: [NSArray arrayWithObject: usersUrl]
- ofValuesTaggedAs: @"D:href"];
-}
-
-- (SOGoDAVSet *) davCurrentUserPrivilegeSet
-{
- SOGoDAVAuthenticator *sAuth;
- SoUser *user;
- NSArray *roles;
- SoClassSecurityInfo *sInfo;
- NSArray *davPermissions;
-
- sAuth = [SOGoDAVAuthenticator sharedSOGoDAVAuthenticator];
- user = [sAuth userInContext: context];
- roles = [user rolesForObject: self inContext: context];
- sInfo = [[self class] soClassSecurityInfo];
-
- davPermissions
- = [[sInfo DAVPermissionsForRoles: roles] stringsWithFormat: @"<D:%@/>"];
-
- return [SOGoDAVSet davSetWithArray: davPermissions
- ofValuesTaggedAs: @"D:privilege"];
-}
-
-- (SOGoDAVSet *) davSupportedPrivilegeSet
-{
- SoClassSecurityInfo *sInfo;
- NSArray *allPermissions;
-
- sInfo = [[self class] soClassSecurityInfo];
-
- allPermissions = [[sInfo allDAVPermissions] stringsWithFormat: @"<D:%@/>"];
-
- return [SOGoDAVSet davSetWithArray: allPermissions
- ofValuesTaggedAs: @"D:privilege"];
-}
-
-- (NSArray *) _davAcesFromAclsDictionary: (NSDictionary *) aclsDictionary
-{
- NSEnumerator *keys;
- NSArray *privileges;
- NSMutableString *currentAce;
- NSMutableArray *davAces;
- NSString *currentKey, *principal;
- SOGoDAVSet *privilegesDS;
-
- davAces = [NSMutableArray array];
- keys = [[aclsDictionary allKeys] objectEnumerator];
- currentKey = [keys nextObject];
- while (currentKey)
- {
- currentAce = [NSMutableString string];
- if ([currentKey hasPrefix: @":"])
- [currentAce
- appendFormat: @"<D:principal><D:property><D:%@/></D:property></D:principal>",
- [currentKey substringFromIndex: 1]];
- else
- {
- principal = [NSString stringWithFormat: @"%@users/%@",
- [self rootURLInContext: context],
- currentKey];
- [currentAce
- appendFormat: @"<D:principal><D:href>%@</D:href></D:principal>",
- principal];
- }
-
- privileges = [[aclsDictionary objectForKey: currentKey]
- stringsWithFormat: @"<D:%@/>"];
- privilegesDS = [SOGoDAVSet davSetWithArray: privileges
- ofValuesTaggedAs: @"privilege"];
- [currentAce appendString: [privilegesDS stringForTag: @"{DAV:}grant"
- rawName: @"grant"
- inContext: nil prefixes: nil]];
- [davAces addObject: currentAce];
- currentKey = [keys nextObject];
- }
-
- return davAces;
-}
-
-- (void) _appendRolesForPseudoPrincipals: (NSMutableDictionary *) aclsDictionary
- withClassSecurityInfo: (SoClassSecurityInfo *) sInfo
-{
- NSArray *perms;
-
- perms = [sInfo DAVPermissionsForRole: SoRole_Owner];
- if ([perms count])
- [aclsDictionary setObject: perms forKey: @":owner"];
- perms = [sInfo DAVPermissionsForRole: SoRole_Authenticated];
- if ([perms count])
- [aclsDictionary setObject: perms forKey: @":authenticated"];
- perms = [sInfo DAVPermissionsForRole: SoRole_Anonymous];
- if ([perms count])
- [aclsDictionary setObject: perms forKey: @":unauthenticated"];
-}
-
-- (SOGoDAVSet *) davAcl
-{
- NSArray *roles;
- NSEnumerator *uids;
- NSMutableDictionary *aclsDictionary;
- NSString *currentUID;
- SoClassSecurityInfo *sInfo;
-
- aclsDictionary = [NSMutableDictionary dictionary];
- uids = [[self aclUsers] objectEnumerator];
- sInfo = [[self class] soClassSecurityInfo];
-
- currentUID = [uids nextObject];
- while (currentUID)
- {
- roles = [self aclsForUser: currentUID];
- [aclsDictionary setObject: [sInfo DAVPermissionsForRoles: roles]
- forKey: currentUID];
- currentUID = [uids nextObject];
- }
- [self _appendRolesForPseudoPrincipals: aclsDictionary
- withClassSecurityInfo: sInfo];
-
- return [SOGoDAVSet davSetWithArray:
- [self _davAcesFromAclsDictionary: aclsDictionary]
- ofValuesTaggedAs: @"D:ace"];
-}
-
/* end of properties */
- (BOOL) doesRetainContainer
nameInContainer = nil;
container = nil;
owner = nil;
+ webdavAclManager = [[self class] webdavAclManager];
}
return self;
{
id obj;
SOGoCache *cache;
- NSString *objcMethod;
+ NSString *objcMethod, *httpMethod;
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];
- else
+ httpMethod = [[localContext request] method];
+ if ([httpMethod isEqualToString: @"REPORT"])
{
objcMethod = [self _reportSelector: lookupName];
if (objcMethod)
[obj autorelease];
}
}
+ else
+ {
+ obj = [[self soClass] lookupKey: lookupName inContext: localContext];
+ if (obj)
+ [obj bindToObject: self inContext: localContext];
+ }
if (obj)
[cache registerObject: obj withName: lookupName inContainer: self];
return [container lookupUserFolder];
}
-- (SOGoGroupsFolder *) lookupGroupsFolder
-{
- return [[self lookupUserFolder] lookupGroupsFolder];
-}
+// - (SOGoGroupsFolder *) lookupGroupsFolder
+// {
+// return [[self lookupUserFolder] lookupGroupsFolder];
+// }
- (void) sleep
{
return [self nameInContainer];
}
+/* DAV ACL properties */
+- (SOGoWebDAVValue *) davOwner
+{
+ NSDictionary *ownerHREF;
+ NSString *usersUrl;
+
+ usersUrl = [NSString stringWithFormat: @"%@%@/",
+ [[WOApplication application] davURL], owner];
+ ownerHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
+
+ return [davElementWithContent (@"owner", @"DAV:", ownerHREF)
+ asWebDAVValue];
+}
+
+- (SOGoWebDAVValue *) davAclRestrictions
+{
+ NSArray *restrictions;
+
+ restrictions = [NSArray arrayWithObjects:
+ davElement (@"grant-only", @"DAV:"),
+ davElement (@"no-invert", @"DAV:"),
+ nil];
+
+ return [davElementWithContent (@"acl-restrictions", @"DAV:", restrictions)
+ asWebDAVValue];
+}
+
+- (SOGoWebDAVValue *) davPrincipalCollectionSet
+{
+ NSString *usersUrl;
+ NSDictionary *collectionHREF;
+
+ /* WOApplication has no support for the DAV methods we define here so we
+ use the user's principal object as a reference */
+ usersUrl = [NSString stringWithFormat: @"%@%@/",
+ [[WOApplication application] davURL], owner];
+ collectionHREF = davElementWithContent (@"href", @"DAV:", usersUrl);
+
+ return [davElementWithContent (@"principal-collection-set",
+ @"DAV:",
+ [NSArray arrayWithObject: collectionHREF])
+ asWebDAVValue];
+}
+
+- (NSArray *) _davPrivilegesFromRoles: (NSArray *) roles
+{
+ NSEnumerator *privileges;
+ NSDictionary *privilege;
+ NSMutableArray *davPrivileges;
+
+ davPrivileges = [NSMutableArray array];
+
+ privileges = [[webdavAclManager davPermissionsForRoles: roles
+ onObject: self] objectEnumerator];
+ while ((privilege = [privileges nextObject]))
+ [davPrivileges addObject: davElementWithContent (@"privilege", @"DAV:",
+ privilege)];
+
+ return davPrivileges;
+}
+
+- (SOGoWebDAVValue *) davCurrentUserPrivilegeSet
+{
+ NSArray *userRoles;
+
+ userRoles = [[context activeUser] rolesForObject: self inContext: context];
+
+ return [davElementWithContent (@"current-user-privilege-set",
+ @"DAV:",
+ [self _davPrivilegesFromRoles: userRoles])
+ asWebDAVValue];
+}
+
+- (SOGoWebDAVValue *) davSupportedPrivilegeSet
+{
+ return [davElementWithContent (@"supported-privilege-set",
+ @"DAV:",
+ [webdavAclManager treeAsWebDAVValue])
+ asWebDAVValue];
+}
+
+#warning this method has probably some code shared with its pseudo principal equivalent
+- (void) _fillAces: (NSMutableArray *) aces
+ withRolesForUID: (NSString *) currentUID
+{
+ NSMutableArray *currentAce;
+ NSArray *roles;
+ NSDictionary *currentGrant, *userHREF;
+ NSString *principalURL;
+
+ currentAce = [NSMutableArray new];
+ roles = [[SOGoUser userWithLogin: currentUID roles: nil]
+ rolesForObject: self
+ inContext: context];
+ if ([roles count])
+ {
+ principalURL = [NSString stringWithFormat: @"%@%@/",
+ [[WOApplication application] davURL],
+ currentUID];
+ userHREF = davElementWithContent (@"href", @"DAV:", principalURL);
+ [currentAce addObject: davElementWithContent (@"principal", @"DAV:",
+ userHREF)];
+ currentGrant
+ = davElementWithContent (@"grant", @"DAV:",
+ [self _davPrivilegesFromRoles: roles]);
+ [currentAce addObject: currentGrant];
+ [aces addObject: davElementWithContent (@"ace", @"DAV:", currentAce)];
+ [currentAce release];
+ }
+}
+
+- (void) _fillAcesWithRolesForPseudoPrincipals: (NSMutableArray *) aces
+{
+ NSArray *roles, *currentAce;
+ NSDictionary *principal, *currentGrant;
+ SOGoUser *user;
+
+// DAV:self, DAV:property(owner), DAV:authenticated
+ user = [context activeUser];
+ roles = [user rolesForObject: self inContext: context];
+ if ([roles count])
+ {
+ principal = davElement (@"self", @"DAV:");
+ currentGrant
+ = davElementWithContent (@"grant", @"DAV:",
+ [self _davPrivilegesFromRoles: roles]);
+ currentAce = [NSArray arrayWithObjects:
+ davElementWithContent (@"principal", @"DAV:",
+ principal),
+ currentGrant, nil];
+ [aces addObject: davElementWithContent (@"ace", @"DAV:", currentAce)];
+ }
+
+ user = [SOGoUser userWithLogin: [self ownerInContext: context] roles: nil];
+ roles = [user rolesForObject: self inContext: context];
+ if ([roles count])
+ {
+ principal = davElementWithContent (@"property", @"DAV:",
+ davElement (@"owner", @"DAV:"));
+ currentGrant
+ = davElementWithContent (@"grant", @"DAV:",
+ [self _davPrivilegesFromRoles: roles]);
+ currentAce = [NSArray arrayWithObjects:
+ davElementWithContent (@"principal", @"DAV:",
+ principal),
+ currentGrant, nil];
+ [aces addObject: davElementWithContent (@"ace", @"DAV:", currentAce)];
+ }
+
+ roles = [self aclsForUser: [self defaultUserID]];
+ if ([roles count])
+ {
+ principal = davElement (@"authenticated", @"DAV:");
+ currentGrant
+ = davElementWithContent (@"grant", @"DAV:",
+ [self _davPrivilegesFromRoles: roles]);
+ currentAce = [NSArray arrayWithObjects:
+ davElementWithContent (@"principal", @"DAV:",
+ principal),
+ currentGrant, nil];
+ [aces addObject: davElementWithContent (@"ace", @"DAV:", currentAce)];
+ }
+}
+
+- (SOGoWebDAVValue *) davAcl
+{
+ NSEnumerator *uids;
+ NSMutableArray *aces;
+ NSString *currentUID;
+
+ aces = [NSMutableArray array];
+
+ [self _fillAcesWithRolesForPseudoPrincipals: aces];
+ uids = [[self aclUsers] objectEnumerator];
+ while ((currentUID = [uids nextObject]))
+ [self _fillAces: aces withRolesForUID: currentUID];
+
+ return [davElementWithContent (@"acl", @"DAV:", aces)
+ asWebDAVValue];
+}
+
+#warning all REPORT method should be standardized...
+- (NSDictionary *) _formalizePrincipalMatchResponse: (NSArray *) hrefs
+{
+ NSDictionary *multiStatus;
+ NSEnumerator *hrefList;
+ NSString *currentHref;
+ NSMutableArray *responses;
+ NSArray *responseElements;
+
+ responses = [NSMutableArray new];
+
+ hrefList = [hrefs objectEnumerator];
+ while ((currentHref = [hrefList nextObject]))
+ {
+ responseElements
+ = [NSArray arrayWithObjects: davElementWithContent (@"href", @"DAV:",
+ currentHref),
+ davElementWithContent (@"status", @"DAV:",
+ @"HTTP/1.1 200 OK"),
+ nil];
+ [responses addObject: davElementWithContent (@"response", @"DAV:",
+ responseElements)];
+ }
+
+ multiStatus = davElementWithContent (@"multistatus", @"DAV:", responses);
+ [responses release];
+
+ return multiStatus;
+}
+
+- (NSDictionary *) _handlePrincipalMatchSelf
+{
+ NSString *davURL, *userLogin;
+ NSArray *principalURL;
+
+ davURL = [[WOApplication application] davURL];
+ userLogin = [[context activeUser] login];
+ principalURL
+ = [NSArray arrayWithObject: [NSString stringWithFormat: @"%@%@/", davURL,
+ userLogin]];
+ return [self _formalizePrincipalMatchResponse: principalURL];
+}
+
+- (void) _fillArrayWithPrincipalsOwnedBySelf: (NSMutableArray *) hrefs
+{
+ NSString *url;
+ NSArray *roles;
+
+ roles = [[context activeUser] rolesForObject: self inContext: context];
+ if ([roles containsObject: SoRole_Owner])
+ {
+ url = [[self davURL] absoluteString];
+ [hrefs addObject: url];
+ }
+}
+
+- (NSDictionary *)
+ _handlePrincipalMatchPrincipalProperty: (id <DOMElement>) child
+{
+ NSMutableArray *hrefs;
+ NSDictionary *response;
+
+ hrefs = [NSMutableArray new];
+ [self _fillArrayWithPrincipalsOwnedBySelf: hrefs];
+
+ response = [self _formalizePrincipalMatchResponse: hrefs];
+ [hrefs release];
+
+ return response;
+}
+
+- (NSDictionary *) _handlePrincipalMatchReport: (id <DOMDocument>) document
+{
+ NSDictionary *response;
+ id <DOMElement> documentElement, queryChild;
+ NSArray *children;
+ NSString *queryTag;
+
+ documentElement = [document documentElement];
+ children = [self domNode: documentElement
+ getChildNodesByType: DOM_ELEMENT_NODE];
+ if ([children count] == 1)
+ {
+ queryChild = [children objectAtIndex: 0];
+ queryTag = [queryChild tagName];
+ if ([queryTag isEqualToString: @"self"])
+ response = [self _handlePrincipalMatchSelf];
+ else if ([queryTag isEqualToString: @"principal-property"])
+ response = [self _handlePrincipalMatchPrincipalProperty: queryChild];
+ else
+ response = [NSException exceptionWithHTTPStatus: 400
+ reason: @"Query element must be either "
+ @" '{DAV:}principal-property' or '{DAV:}self'"];
+ }
+ else
+ response = [NSException exceptionWithHTTPStatus: 400
+ reason: @"Query must have one element:"
+ @" '{DAV:}principal-property' or '{DAV:}self'"];
+
+ return response;
+}
+
+- (WOResponse *) davPrincipalMatch: (WOContext *) localContext
+{
+ WOResponse *r;
+ id <DOMDocument> document;
+ NSDictionary *xmlResponse;
+
+ r = [context response];
+
+ document = [[context request] contentAsDOMDocument];
+ xmlResponse = [self _handlePrincipalMatchReport: document];
+ if ([xmlResponse isKindOfClass: [NSException class]])
+ r = (WOResponse *) xmlResponse;
+ else
+ {
+ [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:
+ @"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"];
+ [r appendContentString: [xmlResponse asWebDavStringWithNamespaces: nil]];
+ }
+
+ return r;
+}
+
/* actions */
- (id) DELETEAction: (id) _ctx
if ([rq isSoWebDAVRequest])
{
cType = [rq headerForKey: @"content-type"];
- if ([cType isEqualToString: @"application/xml"])
+ if ([cType hasPrefix: @"application/xml"]
+ || [cType hasPrefix: @"text/xml"])
{
document = [rq contentAsDOMDocument];
command = [[self _parseXMLCommand: document] davMethodToObjC];
/* description */
-- (void)appendAttributesToDescription:(NSMutableString *)_ms {
+- (void) appendAttributesToDescription: (NSMutableString *) _ms
+{
if (nameInContainer)
[_ms appendFormat:@" name=%@", nameInContainer];
if (container)
container, [container valueForKey:@"nameInContainer"]];
}
-- (NSString *)description {
+- (NSString *) description
+{
NSMutableString *ms;
ms = [NSMutableString stringWithCapacity:64];
}
/* dav acls */
-- (NSArray *) davNamespaces
-{
- return [NSArray arrayWithObject:
- @"urn:inverse:params:xml:ns:inverse-dav"];
-}
-
- (NSString *) davRecordForUser: (NSString *) user
{
NSMutableString *userRecord;
return exception;
}
-- (NSArray *) davSupportedReportSet
+- (SOGoWebDAVValue *) davSupportedReportSet
{
+ NSDictionary *currentValue;
NSEnumerator *reportKeys;
NSMutableArray *reportSet;
- NSString *currentKey, *currentValue;
+ NSString *currentKey;
reportSet = [NSMutableArray array];
while ((currentKey = [reportKeys nextObject]))
if ([self _reportSelector: currentKey])
{
- currentValue = [[currentKey asDavInvocation]
- keysWithFormat: @"<%{method} xmlns=\"%{ns}\"/>"];
- [reportSet addObject: [SoWebDAVValue valueForObject: currentValue
- attributes: nil]];
+ currentValue = [currentKey asDavInvocation];
+ [reportSet addObject: davElementWithContent(@"report",
+ @"DAV:",
+ currentValue)];
}
- return [SOGoDAVSet davSetWithArray: reportSet ofValuesTaggedAs: @"report"];
+ return [davElementWithContent (@"supported-report-set", @"DAV:", reportSet)
+ asWebDAVValue];
}
@end /* SOGoObject */
+
+@implementation SOGoObject (SOGoDomHelpers)
+
+- (NSArray *) domNode: (id <DOMNode>) node
+ getChildNodesByType: (DOMNodeType ) type
+{
+ NSMutableArray *nodes;
+ id <DOMNode> currentChild;
+
+ nodes = [NSMutableArray array];
+
+ currentChild = [node firstChild];
+ while (currentChild)
+ {
+ if ([currentChild nodeType] == type)
+ [nodes addObject: currentChild];
+ currentChild = [currentChild nextSibling];
+ }
+
+ return nodes;
+}
+
+@end
#import <GDLContentStore/NSURL+GCS.h>
#import <GDLAccess/EOAdaptorChannel.h>
+#import "NSObject+DAV.h"
#import "SOGoGCSFolder.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
+#import "SOGoWebDAVAclManager.h"
#import "SOGoParentFolder.h"
sm = [SoSecurityManager sharedSecurityManager];
}
++ (SOGoWebDAVAclManager *) webdavAclManager
+{
+ SOGoWebDAVAclManager *webdavAclManager = nil;
+
+ if (!webdavAclManager)
+ {
+ webdavAclManager = [SOGoWebDAVAclManager new];
+ [webdavAclManager registerDAVPermission: davElement (@"read", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"read-current-user-privilege-set", @"DAV:")
+ abstract: NO
+ withEquivalent: SoPerm_WebDAVAccess
+ asChildOf: davElement (@"read", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"write", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"all", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"bind", @"DAV:")
+ abstract: NO
+ withEquivalent: SoPerm_AddFolders
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager registerDAVPermission: davElement (@"unbind", @"DAV:")
+ abstract: NO
+ withEquivalent: SoPerm_DeleteObjects
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-properties", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"write", @"DAV:")];
+ [webdavAclManager
+ registerDAVPermission: davElement (@"write-content", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: davElement (@"write", @"DAV:")];
+ }
+
+ return webdavAclManager;
+}
+
- (id) init
{
if ((self = [super init]))
extern NSString *SOGoPerm_AccessObject;
extern NSString *SOGoPerm_ReadAcls;
-extern NSString *SOGoPerm_SaveAcls;
extern NSString *SOGoPerm_FreeBusyLookup;
extern NSString *SOGoCalendarPerm_ViewWholePublicRecords;
NSString *SOGoPerm_ReadAcls = @"ReadAcls"; /* the equivalent of "read-acl" in
the WebDAV acls spec, which is
currently missing from SOPE */
-NSString *SOGoPerm_SaveAcls = @"SaveAcls";
NSString *SOGoPerm_FreeBusyLookup = @"FreeBusyLookup";
NSString *SOGoCalendarPerm_ViewWholePublicRecords = @"ViewWholePublicRecords";
NSString *SOGoCalendarPerm_ViewDAndT = @"ViewDAndT";
NSString *SOGoCalendarPerm_ModifyComponent = @"ModifyComponent";
NSString *SOGoCalendarPerm_RespondToComponent = @"RespondToComponent";
-
return cos;
}
+- (NSString *) davDisplayName
+{
+ return [[LDAPUserManager sharedUserManager]
+ getCNForUID: nameInContainer];
+}
+
- (BOOL) davIsCollection
{
return YES;
}
-// /* CalDAV support */
-// - (NSArray *) davCalendarHomeSet
-// {
-// /*
-// <C:calendar-home-set xmlns:D="DAV:"
-// xmlns:C="urn:ietf:params:xml:ns:caldav">
-// <D:href>http://cal.example.com/home/bernard/calendars/</D:href>
-// </C:calendar-home-set>
-
-// Note: this is the *container* for calendar collections, not the
-// collections itself. So for use its the home folder, the
-// public folder and the groups folder.
-// */
-// NSArray *tag;
-// SOGoAppointmentFolders *parent;
-
-// parent = [self privateCalendars: @"Calendar" inContext: context];
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [parent davURL], nil];
-
-// return [NSArray arrayWithObject: tag];
-// }
-
-// - (NSArray *) davCalendarUserAddressSet
-// {
-// NSArray *tag, *allEmails;
-// NSMutableArray *addresses;
-// NSEnumerator *emails;
-// NSString *currentEmail;
-
-// addresses = [NSMutableArray array];
-
-// allEmails = [[context activeUser] allEmails];
-// emails = [allEmails objectEnumerator];
-// while ((currentEmail = [emails nextObject]))
-// {
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [NSString stringWithFormat: @"MAILTO:%@", currentEmail],
-// nil];
-// [addresses addObject: tag];
-// }
-
-// return addresses;
-// }
-
-// - (NSArray *) davCalendarScheduleInboxURL
-// {
-// NSArray *tag;
-// SOGoAppointmentFolders *parent;
-
-// parent = [self privateCalendars: @"Calendar" inContext: context];
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
-// nil];
-
-// return [NSArray arrayWithObject: tag];
-// }
-
-// - (NSString *) davCalendarScheduleOutboxURL
-// {
-// NSArray *tag;
-// SOGoAppointmentFolders *parent;
-
-// parent = [self privateCalendars: @"Calendar" inContext: context];
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
-// nil];
-
-// return [NSArray arrayWithObject: tag];
-// }
-
-// - (NSString *) davDropboxHomeURL
-// {
-// NSArray *tag;
-// SOGoAppointmentFolders *parent;
-
-// parent = [self privateCalendars: @"Calendar" inContext: context];
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
-// nil];
-
-// return [NSArray arrayWithObject: tag];
-// }
-
-// - (NSString *) davNotificationsURL
-// {
-// NSArray *tag;
-// SOGoAppointmentFolders *parent;
-
-// parent = [self privateCalendars: @"Calendar" inContext: context];
-// tag = [NSArray arrayWithObjects: @"href", @"DAV:", @"D",
-// [NSString stringWithFormat: @"%@personal/", [parent davURL]],
-// nil];
-
-// return [NSArray arrayWithObject: tag];
-// }
-
@end /* SOGoUserFolder */
--- /dev/null
+/* SOGoWebDAVAclManager.h - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef SOGOWEBDAVACLMANAGER_H
+#define SOGOWEBDAVACLMANAGER_H
+
+#import <Foundation/NSObject.h>
+
+@class NSDictionary;
+@class NSMutableDictionary;
+@class NSString;
+
+@class SOGoObject;
+@class SOGoUser;
+@class SOGoWebDAVValue;
+
+@interface SOGoWebDAVAclManager : NSObject
+{
+ NSMutableDictionary *aclTree;
+}
+
+- (void) registerDAVPermission: (NSDictionary *) davPermission
+ abstract: (BOOL) abstract
+ withEquivalent: (NSString *) sogoPermission
+ asChildOf: (NSDictionary *) otherDAVPermission;
+
+- (NSArray *) davPermissionsForRoles: (NSArray *) roles
+ onObject: (SOGoObject *) object;
+
+- (SOGoWebDAVValue *) treeAsWebDAVValue;
+
+@end
+
+#endif /* SOGOWEBDAVACLMANAGER_H */
--- /dev/null
+/* SOGoWebDAVAclManager.m - this file is part of SOGo
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSArray.h>
+#import <Foundation/NSString.h>
+#import <Foundation/NSValue.h>
+
+#import <NGObjWeb/SoClass.h>
+#import <NGObjWeb/SoClassSecurityInfo.h>
+#import <NGExtensions/NSObject+Logs.h>
+
+#import "NSDictionary+Utilities.h"
+#import "NSObject+DAV.h"
+#import "SOGoObject.h"
+#import "SOGoUser.h"
+#import "SOGoWebDAVValue.h"
+
+#import "SOGoWebDAVAclManager.h"
+
+static NSNumber *yesObject = nil;
+
+@interface SoClass (SOGoDAVPermissions)
+
+- (BOOL) userRoles: (NSArray *) userRoles
+ havePermission: (NSString *) permission;
+
+@end
+
+@implementation SoClass (SOGoDAVPermissions)
+
+- (BOOL) userRoles: (NSArray *) userRoles
+ havePermission: (NSString *) permission
+{
+ BOOL result;
+ SoClass *currentClass;
+ NSArray *roles;
+
+ result = NO;
+
+ currentClass = self;
+ while (!result && currentClass)
+ {
+ roles = [[currentClass soClassSecurityInfo]
+ defaultRolesForPermission: permission];
+ if ([roles firstObjectCommonWithArray: userRoles])
+ {
+ NSLog (@"matched '%@': %@", permission, roles);
+ result = YES;
+ }
+ else
+ currentClass = [currentClass soSuperClass];
+ }
+
+ return result;
+}
+
+@end
+
+@implementation SOGoWebDAVAclManager
+
++ (void) initialize
+{
+ if (!yesObject)
+ {
+ yesObject = [NSNumber numberWithBool: YES];
+ [yesObject retain];
+ }
+}
+
+- (id) init
+{
+ if ((self = [super init]))
+ {
+ aclTree = [NSMutableDictionary new];
+ [self registerDAVPermission: davElement (@"all", @"DAV:")
+ abstract: YES
+ withEquivalent: nil
+ asChildOf: nil];
+ }
+
+ return self;
+}
+
+- (void) dealloc
+{
+ [aclTree release];
+ [super dealloc];
+}
+
+- (void) _registerChild: (NSMutableDictionary *) newEntry
+ of: (NSDictionary *) parentPermission
+{
+ NSString *identifier;
+ NSMutableDictionary *parentEntry;
+ NSMutableArray *children;
+
+ identifier = [parentPermission keysWithFormat: @"{%{ns}}%{method}"];
+ parentEntry = [aclTree objectForKey: identifier];
+ if (!parentEntry)
+ [self warnWithFormat: @"parent entry '%@' does not exist in DAV"
+ @" permissions table", identifier];
+ children = [parentEntry objectForKey: @"children"];
+ if (!children)
+ {
+ children = [NSMutableArray new];
+ [parentEntry setObject: children forKey: @"children"];
+ [children release];
+ }
+ [children addObject: newEntry];
+ [newEntry setObject: parentEntry forKey: @"parent"];
+}
+
+- (void) registerDAVPermission: (NSDictionary *) davPermission
+ abstract: (BOOL) abstract
+ withEquivalent: (NSString *) sogoPermission
+ asChildOf: (NSDictionary *) otherDAVPermission
+{
+ NSMutableDictionary *newEntry;
+ NSString *identifier;
+
+ newEntry = [NSMutableDictionary new];
+ identifier = [davPermission keysWithFormat: @"{%{ns}}%{method}"];
+ if ([aclTree objectForKey: identifier])
+ [self warnWithFormat:
+ @"entry '%@' already exists in DAV permissions table",
+ identifier];
+ [aclTree setObject: newEntry forKey: identifier];
+ [newEntry setObject: davPermission forKey: @"permission"];
+ if (abstract)
+ [newEntry setObject: yesObject forKey: @"abstract"];
+ if (sogoPermission)
+ [newEntry setObject: sogoPermission forKey: @"equivalent"];
+
+ if (otherDAVPermission)
+ [self _registerChild: newEntry of: otherDAVPermission];
+
+ [newEntry release];
+}
+
+#warning this method should be simplified!
+/* We add the permissions that fill those conditions:
+ - should match the sogo permissions implied by the user roles
+ If all the child permissions of a permission are included, then this
+ permission will be included too. Conversely, if a permission is included,
+ all the child permissions will be included too. */
+
+- (BOOL) _fillArray: (NSMutableArray *) davPermissions
+ withPermission: (NSDictionary *) permission
+ forUserRoles: (NSArray *) userRoles
+ withSoClass: (SoClass *) soClass
+ matchSOGoPerms: (BOOL) matchSOGoPerms
+{
+ NSString *sogoPermission;
+ NSDictionary *childPermission;
+ NSEnumerator *children;
+ BOOL appended, childrenAppended;
+
+ appended = YES;
+ if (matchSOGoPerms)
+ {
+ sogoPermission = [permission objectForKey: @"equivalent"];
+ if (sogoPermission
+ && [soClass userRoles: userRoles havePermission: sogoPermission])
+ {
+ [davPermissions
+ addObject: [permission objectForKey: @"permission"]];
+ }
+ else
+ appended = NO;
+ }
+ else
+ [davPermissions
+ addObject: [permission objectForKey: @"permission"]];
+
+ children = [[permission objectForKey: @"children"] objectEnumerator];
+ if (children)
+ {
+ childrenAppended = YES;
+ while ((childPermission = [children nextObject]))
+ childrenAppended = (childrenAppended
+ && [self _fillArray: davPermissions
+ withPermission: childPermission
+ forUserRoles: userRoles
+ withSoClass: soClass
+ matchSOGoPerms: (matchSOGoPerms && !appended)]);
+ if (childrenAppended && !appended)
+ {
+ [davPermissions
+ addObject: [permission objectForKey: @"permission"]];
+ appended = YES;
+ }
+ }
+
+ return appended;
+}
+
+- (NSArray *) davPermissionsForRoles: (NSArray *) roles
+ onObject: (SOGoObject *) object
+{
+ NSMutableArray *davPermissions;
+ SoClass *soClass;
+
+ davPermissions = [NSMutableArray array];
+ soClass = [[object class] soClass];
+ [self _fillArray: davPermissions
+ withPermission: [aclTree objectForKey: @"{DAV:}all"]
+ forUserRoles: roles
+ withSoClass: soClass
+ matchSOGoPerms: YES];
+
+ return davPermissions;
+}
+
+- (SOGoWebDAVValue *)
+ _supportedPrivilegeSetFromPermission: (NSDictionary *) perm
+{
+ NSMutableArray *privilege;
+ NSEnumerator *children;
+ NSDictionary *currentPerm;
+
+ privilege = [NSMutableArray array];
+ [privilege addObject:
+ davElementWithContent (@"privilege",
+ @"DAV:",
+ [perm objectForKey: @"permission"])];
+ if ([[perm objectForKey: @"abstract"] boolValue])
+ [privilege addObject: davElement (@"abstract", @"DAV:")];
+ children = [[perm objectForKey: @"children"] objectEnumerator];
+ while ((currentPerm = [children nextObject]))
+ [privilege addObject:
+ [self _supportedPrivilegeSetFromPermission: currentPerm]];
+
+ return davElementWithContent (@"supported-privilege",
+ @"DAV:", privilege);
+}
+
+- (SOGoWebDAVValue *) treeAsWebDAVValue
+{
+ return [self _supportedPrivilegeSetFromPermission:
+ [aclTree objectForKey: @"{DAV:}all"]];
+}
+
+@end
-/* SOGoDAVRendererTypes.h - this file is part of SOGo
+/* SOGoWebDAVValue.h - this file is part of SOGo
*
- * Copyright (C) 2006 Inverse groupe conseil
+ * Copyright (C) 2008 Inverse groupe conseil
*
* Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
*
* Boston, MA 02111-1307, USA.
*/
-#ifndef SOGODAVRENDERERTYPES_H
-#define SOGODAVRENDERERTYPES_H
+#ifndef SOGOWEBDAVVALUE_H
+#define SOGOWEBDAVVALUE_H
#import <NGObjWeb/SoWebDAVValue.h>
-@class NSArray;
-@class NSDictionary;
@class NSString;
-@interface SOGoDAVSet : SoWebDAVValue
-{
- NSString *valueTag;
- NSArray *values;
-}
+@interface SOGoWebDAVValue : SoWebDAVValue
-+ (id) davSetWithArray: (NSArray *) newValues
- ofValuesTaggedAs: (NSString *) newValueTag;
+- (NSString *) stringForTag: (NSString *) _key
+ rawName: (NSString *) setTag
+ inContext: (id) context
+ prefixes: (NSDictionary *) prefixes;
-- (void) setValueTag: (NSString *) newValueTag;
-- (void) setValues: (NSArray *) newValues;
-
@end
-@interface SOGoDAVDictionary : SoWebDAVValue
-{
- NSString *valueTag;
- NSDictionary *values;
-}
-+ (id) davDictionary: (NSDictionary *) newValues
- taggedAs: (NSString *) newValueTag;
-
-- (void) setValueTag: (NSString *) newValueTag;
-- (void) setValues: (NSDictionary *) newValues;
-
-@end
-
-#endif /* SOGODAVRENDERERTYPES_H */
+#endif /* SOGOWEBDAVVALUE_H */
--- /dev/null
+/* SOGoWebDAVValue.m - this file is part of $PROJECT_NAME_HERE$
+ *
+ * Copyright (C) 2008 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSString.h>
+
+#import "SOGoWebDAVValue.h"
+
+@implementation SOGoWebDAVValue : SoWebDAVValue
+
+- (NSString *) stringForTag: (NSString *) _key
+ rawName: (NSString *) setTag
+ inContext: (id) context
+ prefixes: (NSDictionary *) prefixes
+{
+ return object;
+}
+
+@end
-I../../SOPE
ADDITIONAL_LIB_DIRS += \
- -L../SOGo/$(GNUSTEP_OBJ_DIR)/ \
+ -L../SOGo/SOGo.framework/ \
-L../../SOGo/$(GNUSTEP_OBJ_DIR)/ \
-L../../OGoContentStore/$(GNUSTEP_OBJ_DIR)/ \
-L../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ \
Therefore it would be nice to refactor those things a little bit and maybe put
some code from SOGo up into SOPE.
-- wsourdeau@inverse.ca, Tue, 22 Apr 2008 15:21:32 -0400
+
+ACL:
+- the "default user" concept in the SOGo ACL paradigm should probably match
+the "authenticated" role in SOGo/SOPE. Also, we should reconsider the handling
+of the DAV:authenticated principal wrt the DAV ACL interface.
+- we should add support for DAV privilege descriptions
+ -- wsourdeau@inverse.ca, Tue, 29 Apr 2008 12:05:17 -0400
mgr = [SoSecurityManager sharedSecurityManager];
- return (![mgr validatePermission: SOGoPerm_SaveAcls
+ return (![mgr validatePermission: SoPerm_ChangePermissions
onObject: [self clientObject]
inContext: context]);
}
SOGoObject = {
methods = {
addUserInAcls = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
actionClass = "UIxObjectActions";
actionName = "addUserInAcls";
};
removeUserFromAcls = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
actionClass = "UIxObjectActions";
actionName = "removeUserFromAcls";
};
pageName = "UIxAclEditor";
};
saveAcls = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxAclEditor";
actionName = "saveAcls";
};
pageName = "UIxUserRightsEditor";
};
saveUserRights = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxUserRightsEditor";
actionName = "saveUserRights";
};
SOGoParentFolder = {
methods = {
createFolder = {
- protectedBy = "View";
+ protectedBy = "SoPerm_AddFolders";
actionClass = "UIxParentFolderActions";
actionName = "createFolder";
};
actionName = "deactivateFolder";
};
deleteFolder = {
- protectedBy = "SaveAcls"; /* a hack to force "owner" */
+ protectedBy = "Delete Objects";
actionClass = "UIxFolderActions";
actionName = "deleteFolder";
};
renameFolder = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
actionClass = "UIxFolderActions";
actionName = "renameFolder";
};
pageName = "UIxAclEditor";
};
saveAcls = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxAclEditor";
actionName = "saveAcls";
};
pageName = "UIxContactsUserRightsEditor";
};
saveUserRights = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxContactsUserRightsEditor";
actionName = "saveUserRights";
};
iteration = 0;
upperLimit = oldString + oldLength;
- while ((unsigned int) currentChar < (unsigned int) upperLimit)
+ while (currentChar < upperLimit)
{
if (*currentChar != '\r')
{
if (*currentChar == '\n')
{
- length = (unsigned int) destChar - (unsigned int) newString;
+ length = destChar - newString;
if ((length + (6 * iteration) + 500) > maxLength)
{
maxLength = length + (iteration * 6) + 500;
currentChar++;
}
*destChar = 0;
- *newLength = (unsigned int) destChar - (unsigned int) newString;
+ *newLength = destChar - newString;
return newString;
}
pageName = "UIxMailUserRightsEditor";
};
saveUserRights = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxMailUserRightsEditor";
actionName = "saveUserRights";
};
MainUI_OBJC_FILES += \
MainUIProduct.m \
SOGoRootPage.m \
- SOGoUserHomePage.m \
- SOGoGroupPage.m \
- SOGoGroupsPage.m \
+ SOGoUserHomePage.m
+# SOGoGroupPage.m \
+# SOGoGroupsPage.m \
MainUI_RESOURCE_FILES += \
Version \
"Add Documents, Images, and Files" = ( "Owner", "ObjectCreator" );
"Add Folders" = ( "Owner", "FolderCreator" );
"ReadAcls" = ( "Owner" );
- "SaveAcls" = ( "Owner" );
+ "Change Permissions" = ( "Owner" );
"Delete Objects" = ( "Owner", "ObjectEraser" );
"WebDAV Access" = ( "Owner", "ObjectViewer", "ObjectEditor", "ObjectCreator", "ObjectEraser" );
};
defaultRoles = {
"Access Contents Information" = ( "Authenticated" );
"WebDAV Access" = ( "Authenticated" );
+ "Add Folders" = ( "Owner" );
+ "Delete Objects" = ( "Owner" );
};
};
SOGoUserFolder = {
};
};
};
- SOGoGroupsFolder = {
- methods = {
- index = {
- protectedBy = "View";
- pageName = "SOGoGroupsPage";
- };
- };
- };
- SOGoGroupFolder = {
- methods = {
- index = {
- protectedBy = "View";
- pageName = "SOGoGroupPage";
- };
- };
- };
+// SOGoGroupsFolder = {
+// methods = {
+// index = {
+// protectedBy = "View";
+// pageName = "SOGoGroupsPage";
+// };
+// };
+// };
+// SOGoGroupFolder = {
+// methods = {
+// index = {
+// protectedBy = "View";
+// pageName = "SOGoGroupPage";
+// };
+// };
+// };
SOGoFreeBusyObject = {
methods = {
ajaxRead = {
};
};
};
- SOGoCustomGroupFolder = {
- methods = {
- };
- };
+// SOGoCustomGroupFolder = {
+// methods = {
+// };
+// };
};
}
#import <SoObjects/SOGo/SOGoUser.h>
#import <SoObjects/SOGo/SOGoObject.h>
#import <SoObjects/SOGo/SOGoContentObject.h>
-#import <SoObjects/SOGo/SOGoCustomGroupFolder.h>
+// #import <SoObjects/SOGo/SOGoCustomGroupFolder.h>
#import <SoObjects/SOGo/SOGoPermissions.h>
#import "UIxJSClose.h"
{
SOGoObject *currentClient, *parent;
BOOL found;
- Class objectClass, groupFolderClass, userFolderClass;
+ Class objectClass, userFolderClass;
+// , groupFolderClass
currentClient = [self clientObject];
if (currentClient
&& [currentClient isKindOfClass: [SOGoObject class]])
{
- groupFolderClass = [SOGoCustomGroupFolder class];
+// groupFolderClass = [SOGoCustomGroupFolder class];
userFolderClass = [SOGoUserFolder class];
objectClass = [currentClient class];
- found = (objectClass == groupFolderClass || objectClass == userFolderClass);
+// found = (objectClass == groupFolderClass || objectClass == userFolderClass);
+ found = (objectClass == userFolderClass);
while (!found && currentClient)
{
parent = [currentClient container];
objectClass = [parent class];
- if (objectClass == groupFolderClass
- || objectClass == userFolderClass)
+ if (// objectClass == groupFolderClass
+// ||
+ objectClass == userFolderClass)
found = YES;
else
currentClient = parent;
um = [LDAPUserManager sharedUserManager];
attendees = [[component attendees] objectEnumerator];
- currentAttendee = [attendees nextObject];
- while (currentAttendee)
+ while ((currentAttendee = [attendees nextObject]))
{
[names appendFormat: @"%@,", [currentAttendee cn]];
[emails appendFormat: @"%@,", [currentAttendee rfc822Email]];
[uids appendFormat: @"%@,", uid];
else
[uids appendString: @","];
- [states appendFormat: @"%@,", [[currentAttendee partStat] lowercaseString]];
- currentAttendee = [attendees nextObject];
+ [states appendFormat: @"%@,",
+ [[currentAttendee partStat] lowercaseString]];
}
if ([names length] > 0)
-{ /* -*-javascript-*- */
+{ /* -*-java-*- */
requires = ( MAIN, MainUI, CommonUI, Appointments, Contacts, ContactsUI );
publicResources = (
pageName = "UIxCalUserRightsEditor";
};
saveUserRights = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxCalUserRightsEditor";
actionName = "saveUserRights";
};
pageName = "UIxCalUserRightsEditor";
};
saveUserRights = {
- protectedBy = "SaveAcls";
+ protectedBy = "Change Permissions";
pageName = "UIxCalUserRightsEditor";
actionName = "saveUserRights";
};
newDiv.appendChild(document.createTextNode(count + " messages..."));
return newDiv;
-}
+};
- var messageListData = function(type) {
- var rows = this.parentNode.parentNode.getSelectedRowsId();
- var msgIds = new Array();
- for (var i = 0; i < rows.length; i++)
- msgIds.push(rows[i].substr(4));
+var messageListData = function(type) {
+ var rows = this.parentNode.parentNode.getSelectedRowsId();
+ var msgIds = new Array();
+ for (var i = 0; i < rows.length; i++)
+ msgIds.push(rows[i].substr(4));
- return msgIds;
- }
+ return msgIds;
+}
/* a model for a futur refactoring of the sortable table headers mechanism */
function configureMessageListEvents(table) {
if ($(cell).hasClassName("tbtv_navcell")) {
var anchors = $(cell).childNodesWithTag("a");
for (var i = 0; i < anchors.length; i++)
- anchors[i].observe("click",
- openMailboxAtIndex.bindAsEventListener(anchors[i]));
+ $(anchors[i]).observe("click", openMailboxAtIndex);
}
rows = table.tBodies[0].rows;
for (var i = 0; i < rows.length; i++) {
- rows[i].observe("mousedown", onRowClick);
- rows[i].observe("selectstart", listRowMouseDownHandler);
- rows[i].observe("contextmenu", onMessageContextMenu.bindAsEventListener(rows[i]));
+ var row = $(rows[i]);
+ row.observe("mousedown", onRowClick);
+ row.observe("selectstart", listRowMouseDownHandler);
+ row.observe("contextmenu", onMessageContextMenu);
- rows[i].dndTypes = function() { return new Array("mailRow"); };
- rows[i].dndGhost = messageListGhost;
- rows[i].dndDataForType = messageListData;
- // document.DNDManager.registerSource(rows[i]);
+ row.dndTypes = function() { return new Array("mailRow"); };
+ row.dndGhost = messageListGhost;
+ row.dndDataForType = messageListData;
+ // document.DNDManager.registerSource(row);
- for (var j = 0; j < rows[i].cells.length; j++) {
- var cell = rows[i].cells[j];
+ for (var j = 0; j < row.cells.length; j++) {
+ var cell = $(row.cells[j]);
cell.observe("mousedown", listRowMouseDownHandler);
if (j == 2 || j == 3 || j == 5)
cell.observe("dblclick", onMessageDoubleClick.bindAsEventListener(cell));
else if (j == 4) {
- var img = cell.childNodesWithTag("img")[0];
+ var img = $(cell.childNodesWithTag("img")[0]);
img.observe("click", mailListMarkMessage.bindAsEventListener(img));
}
}
list.appendChild(listItem);
listItem.observe("mousedown", listRowMouseDownHandler);
listItem.observe("click", onRowClick);
- listItem.observe("dblclick",
- editDoubleClickedEvent);
+ listItem.observe("dblclick", editDoubleClickedEvent);
listItem.setAttribute("id", data[i][0]);
$(listItem).addClassName(data[i][5]);
$(listItem).addClassName(data[i][6]);
var input = document.createElement("input");
input.setAttribute("type", "checkbox");
listItem.appendChild(input);
- // input.observe("click", updateTaskStatus, true);
+ input.observe("click", updateTaskStatus, true);
input.setAttribute("value", "1");
if (data[i][2] == 1)
input.setAttribute("checked", "checked");
var items = list.childNodesWithTag("li");
for (var i = 0; i < items.length; i++) {
var input = items[i].childNodesWithTag("input")[0];
- input.observe("click", updateCalendarStatus);
+ $(input).observe("click", updateCalendarStatus);
items[i].observe("mousedown", listRowMouseDownHandler);
items[i].observe("selectstart", listRowMouseDownHandler);
items[i].observe("click", onRowClick);
function onTextFirstFocus() {
var content = this.getValue();
if (content.lastIndexOf("--") == 0) {
- this.insertBefore(document.createTextNode("\r\n"),
+ this.insertBefore(document.createTextNode("\r"),
this.lastChild);
}
if (signatureLength > 0) {
- var length = this.getValue().length - signatureLength - 1;
+ var length = this.getValue().length - signatureLength - 2;
this.setCaretTo(length);
}
Event.stopObserving(this, "focus", onTextFirstFocus);
log("AJAX Request, Caught Exception: " + e.name);
log(e.message);
log(backtrace());
+ log("request url was '" + http.url + "'");
}
}
if (progressImage)
progressImage.parentNode.removeChild(progressImage);
$(document.body).observe("contextmenu", onBodyClickContextMenu);
+ /* $(document.body).observe("click", testclic); */
+}
+
+function testclic(event) {
+log("test: " + event.target);
+if (event.target) {
+log("tag: " + event.target.tagName);
+log("id: " + event.target.getAttribute("id"));
+log("class: " + event.target.getAttribute("class"));
+}
}
function onBodyClickContextMenu(event) {
/* SOGoRootPage */
+HTML
+{ overflow: hidden; }
+
+FORM
+{ padding: 0px;
+ margin: 0px; }
+
DIV#loginScreen
{ border: 2px solid #fff;
border-right: 2px solid #666;
{ height: 103%; }
TABLE
-{ empty-cells: show; }
\ No newline at end of file
+{ empty-cells: show; }
success: function() {
var status = this.getStatus();
- return !status || (status >= 200 && status < 300);
+ return !status || status == 1223 || (status >= 200 && status < 300);
},
getStatus: function() {
ADDITIONAL_LIB_DIRS += \
-L../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR) \
-L../SOGoUI/$(GNUSTEP_OBJ_DIR) \
- -L../../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)
+ -L../../SoObjects/SOGo/SOGo.framework/
else
RELBUILD_DIR_libNGCards = \
$(GNUSTEP_BUILD_DIR)/../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR_NAME)
RELBUILD_DIR_libSOGo = \
- $(GNUSTEP_BUILD_DIR)/../../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR_NAME)
+ $(GNUSTEP_BUILD_DIR)/../../SoObjects/SOGo/SOGo.framework/
RELBUILD_DIR_libSOGoUI = \
$(GNUSTEP_BUILD_DIR)/../SOGoUI/$(GNUSTEP_OBJ_DIR_NAME)
RELBUILD_DIR_libOGoContentStore = \