Monotone-Parent: 36629dd663854fa20ad91e193b33d65352cc841c

Monotone-Revision: 6b29211b83532bdab288ba2a6d428067b1e81267

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-05-30T20:18:42
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-05-30 20:18:42 +00:00
parent fef4c30572
commit b4859d592f
3 changed files with 154 additions and 11 deletions
+15
View File
@@ -1,5 +1,20 @@
2007-05-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoObject.m ([SOGoObject -davURL]): new method
that returns the full dav url to self.
([SOGoObject -soURL]): same as above but for the so url (Web UI).
([SOGoObject -soURLToBaseContainerForUser:uid]): new method that
returns the full so url to the base of the SOGo module to which
self belongs, and for the specified user.
([SOGoObject -soURLToBaseContainerForCurrentUser]): same as above
but for the current user.
([SOGoObject -httpURLForAdvisoryToUser:uid]): new protocol method
required by the acl advisory templates and which returns a link
the target user can click to activate its new subscription.
([SOGoObject -resourceURLForAdvisoryToUser:uid]): same as above
but for inclusion of the application/x-sogo-notification part,
which will be handled by the Lightning enhancer plugin.
* UI/MailerUI/UIxMailFolderActions.m ([UIxMailFolderActions -subscribeAction])
([UIxMailFolderActions -unsubscribeAction]): new stub methods that
do nothing yet since imap folder subscription is not handled yet.
+12 -1
View File
@@ -41,6 +41,7 @@
@class NSMutableString;
@class NSException;
@class NSTimeZone;
@class NSURL;
@class WOContext;
@class GCSFolderManager;
@@ -69,6 +70,11 @@
- (NSString *) nameInContainer;
- (id) container;
- (NSURL *) davURL;
- (NSURL *) soURL;
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid;
- (NSURL *) soURLToBaseContainerForCurrentUser;
/* ownership */
- (void) setOwner: (NSString *) newOwner;
@@ -104,7 +110,12 @@
forUser: (NSString *) uid;
- (void) removeAclsForUsers: (NSArray *) users;
- (NSString *) defaultUserID;
- (BOOL) hasSupportForDefaultRoles;
- (void) sendACLAdditionAdvisoryToUser: (NSString *) uid;
- (void) sendACLRemovalAdvisoryToUser: (NSString *) uid;
- (NSString *) httpURLForAdvisoryToUser: (NSString *) uid;
- (NSString *) resourceURLForAdvisoryToUser: (NSString *) uid;
/* description */
+127 -10
View File
@@ -24,19 +24,24 @@
Please use gnustep-base instead.
#endif
#import <NGObjWeb/WEClientCapabilities.h>
#import <Foundation/NSClassDescription.h>
#import <Foundation/NSString.h>
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSValue.h>
#import <NGObjWeb/SoClassSecurityInfo.h>
#import <NGObjWeb/SoObject+SoDAV.h>
#import <NGObjWeb/WEClientCapabilities.h>
#import <NGObjWeb/WOApplication.h>
#import <NGObjWeb/WOContext.h>
#import <NGObjWeb/WOResponse.h>
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/WOApplication.h>
#import <NGObjWeb/WORequest+So.h>
#import <NGObjWeb/NSException+HTTP.h>
#import <NGExtensions/NSObject+Logs.h>
#import <NGCards/NSDictionary+NGCards.h>
#import <GDLContentStore/GCSFolder.h>
#import "common.h"
#import "NSArray+Utilities.h"
#import "NSString+Utilities.h"
#import <UI/SOGoUI/SOGoACLAdvisory.h>
#import "SOGoPermissions.h"
#import "SOGoUser.h"
@@ -45,6 +50,9 @@
#import "SOGoDAVRendererTypes.h"
#import "NSArray+Utilities.h"
#import "NSString+Utilities.h"
#import "SOGoObject.h"
@interface SOGoObject(Content)
@@ -737,9 +745,118 @@ static BOOL kontactGroupDAV = YES;
return nil;
}
- (BOOL) hasSupportForDefaultRoles
- (void) sendACLAdvisoryTemplate: (NSString *) template
toUser: (NSString *) uid
{
return NO;
NSString *language, *pageName;
SOGoUser *user;
SOGoACLAdvisory *page;
WOApplication *app;
user = [SOGoUser userWithLogin: uid roles: nil];
language = [user language];
pageName = [NSString stringWithFormat: @"SOGoACL%@%@Advisory",
language, template];
app = [WOApplication application];
page = [app pageWithName: pageName inContext: context];
[page setACLObject: self];
[page setRecipientUID: uid];
[page send];
}
- (void) sendACLAdditionAdvisoryToUser: (NSString *) uid
{
return [self sendACLAdvisoryTemplate: @"Addition"
toUser: uid];
}
- (void) sendACLRemovalAdvisoryToUser: (NSString *) uid
{
return [self sendACLAdvisoryTemplate: @"Removal"
toUser: uid];
}
- (NSURL *) _urlPreferringParticle: (NSString *) expected
overThisOne: (NSString *) possible
{
NSURL *serverURL, *davURL;
NSMutableArray *path;
NSString *baseURL, *urlMethod;
serverURL = [context serverURL];
baseURL = [self baseURLInContext: context];
path = [NSMutableArray arrayWithArray: [baseURL componentsSeparatedByString:
@"/"]];
urlMethod = [path objectAtIndex: 2];
if (![urlMethod isEqualToString: expected])
{
if ([urlMethod isEqualToString: possible])
[path replaceObjectAtIndex: 2 withObject: expected];
else
[path insertObject: expected atIndex: 2];
}
davURL = [[NSURL alloc] initWithScheme: [serverURL scheme]
host: [serverURL host]
path: [path componentsJoinedByString: @"/"]];
[davURL autorelease];
return davURL;
}
- (NSURL *) davURL
{
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
}
- (NSURL *) soURL
{
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
}
- (NSURL *) soURLToBaseContainerForUser: (NSString *) uid
{
NSURL *soURL, *baseSoURL;
NSArray *basePath;
NSMutableArray *newPath;
soURL = [self soURL];
basePath = [[soURL path] componentsSeparatedByString: @"/"];
newPath
= [NSMutableArray arrayWithArray:
[basePath subarrayWithRange: NSMakeRange (0, 5)]];
[newPath replaceObjectAtIndex: 3 withObject: uid];
baseSoURL = [[NSURL alloc] initWithScheme: [soURL scheme]
host: [soURL host]
path: [newPath componentsJoinedByString: @"/"]];
[baseSoURL autorelease];
return baseSoURL;
}
- (NSURL *) soURLToBaseContainerForCurrentUser
{
NSString *currentLogin;
currentLogin = [[context activeUser] login];
return [self soURLToBaseContainerForUser: currentLogin];
}
- (NSString *) httpURLForAdvisoryToUser: (NSString *) uid
{
[self subclassResponsibility: _cmd];
return nil;
}
- (NSString *) resourceURLForAdvisoryToUser: (NSString *) uid
{
[self subclassResponsibility: _cmd];
return nil;
}
/* description */