Monotone-Parent: 59c3c57568af9cf49ee2644db4b869f2bedea64c
Monotone-Revision: 399ddcc3b0b509af5a4d05cd434475774187e48c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-30T16:43:55 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
2fbc2674c4
commit
1bbd867cbe
|
@ -1,5 +1,9 @@
|
||||||
2007-11-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2007-11-30 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder
|
||||||
|
-appendSubscribedSources]): don't include sources for which we
|
||||||
|
don't have the SOGoPerm_AccessObject permission.
|
||||||
|
|
||||||
* SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate
|
* SoObjects/SOGo/NSCalendarDate+SOGo.m ([NSCalendarDate
|
||||||
-rfc822DateString]): we want positive timezones to be specified
|
-rfc822DateString]): we want positive timezones to be specified
|
||||||
with a leading "+" too.
|
with a leading "+" too.
|
||||||
|
|
|
@ -93,7 +93,6 @@ static NSString *defaultUserID = @"<default>";
|
||||||
ocsPath = nil;
|
ocsPath = nil;
|
||||||
ocsFolder = nil;
|
ocsFolder = nil;
|
||||||
aclCache = [NSMutableDictionary new];
|
aclCache = [NSMutableDictionary new];
|
||||||
[self _fetchDisplayName];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -104,7 +103,6 @@ static NSString *defaultUserID = @"<default>";
|
||||||
[ocsFolder release];
|
[ocsFolder release];
|
||||||
[ocsPath release];
|
[ocsPath release];
|
||||||
[aclCache release];
|
[aclCache release];
|
||||||
[displayName release];
|
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,23 +114,25 @@ static NSString *defaultUserID = @"<default>";
|
||||||
NSDictionary *ownerIdentity;
|
NSDictionary *ownerIdentity;
|
||||||
|
|
||||||
primaryDN = [row objectForKey: @"c_foldername"];
|
primaryDN = [row objectForKey: @"c_foldername"];
|
||||||
displayName = [NSMutableString string];
|
if ([primaryDN length])
|
||||||
if ([primaryDN isEqualToString: [container defaultFolderName]])
|
|
||||||
[displayName appendString: [self labelForKey: primaryDN]];
|
|
||||||
else
|
|
||||||
[displayName appendString: primaryDN];
|
|
||||||
|
|
||||||
currentLogin = [[context activeUser] login];
|
|
||||||
ownerLogin = [self ownerInContext: context];
|
|
||||||
if (![currentLogin isEqualToString: ownerLogin])
|
|
||||||
{
|
{
|
||||||
ownerIdentity = [[SOGoUser userWithLogin: ownerLogin roles: nil]
|
displayName = [NSMutableString new];
|
||||||
primaryIdentity];
|
if ([primaryDN isEqualToString: [container defaultFolderName]])
|
||||||
[displayName
|
[displayName appendString: [self labelForKey: primaryDN]];
|
||||||
appendString: [ownerIdentity keysWithFormat:
|
else
|
||||||
@" (%{fullName} <%{email}>)"]];
|
[displayName appendString: primaryDN];
|
||||||
|
|
||||||
|
currentLogin = [[context activeUser] login];
|
||||||
|
ownerLogin = [self ownerInContext: context];
|
||||||
|
if (![currentLogin isEqualToString: ownerLogin])
|
||||||
|
{
|
||||||
|
ownerIdentity = [[SOGoUser userWithLogin: ownerLogin roles: nil]
|
||||||
|
primaryIdentity];
|
||||||
|
[displayName
|
||||||
|
appendString: [ownerIdentity keysWithFormat:
|
||||||
|
@" (%{fullName} <%{email}>)"]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
[displayName retain];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) _fetchDisplayName
|
- (void) _fetchDisplayName
|
||||||
|
@ -166,6 +166,9 @@ static NSString *defaultUserID = @"<default>";
|
||||||
|
|
||||||
- (NSString *) displayName
|
- (NSString *) displayName
|
||||||
{
|
{
|
||||||
|
if (!displayName)
|
||||||
|
[self _fetchDisplayName];
|
||||||
|
|
||||||
return displayName;
|
return displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#import <Foundation/NSUserDefaults.h>
|
#import <Foundation/NSUserDefaults.h>
|
||||||
|
|
||||||
#import <NGObjWeb/NSException+HTTP.h>
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
|
#import <NGObjWeb/SoSecurityManager.h>
|
||||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||||
#import <GDLContentStore/GCSChannelManager.h>
|
#import <GDLContentStore/GCSChannelManager.h>
|
||||||
#import <GDLContentStore/GCSFolderManager.h>
|
#import <GDLContentStore/GCSFolderManager.h>
|
||||||
|
@ -37,8 +38,16 @@
|
||||||
|
|
||||||
#import "SOGoParentFolder.h"
|
#import "SOGoParentFolder.h"
|
||||||
|
|
||||||
|
static SoSecurityManager *sm = nil;
|
||||||
|
|
||||||
@implementation SOGoParentFolder
|
@implementation SOGoParentFolder
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (!sm)
|
||||||
|
sm = [SoSecurityManager sharedSecurityManager];
|
||||||
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
|
@ -171,13 +180,29 @@
|
||||||
#warning TO BE IMPLEMENTED SOON FIXME
|
#warning TO BE IMPLEMENTED SOON FIXME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) _appendSubscribedSource: (NSString *) sourceKey
|
||||||
|
{
|
||||||
|
SOGoGCSFolder *subscribedFolder;
|
||||||
|
|
||||||
|
subscribedFolder
|
||||||
|
= [subFolderClass folderWithSubscriptionReference: sourceKey
|
||||||
|
inContainer: self];
|
||||||
|
if (subscribedFolder
|
||||||
|
&& ![sm validatePermission: SOGoPerm_AccessObject
|
||||||
|
onObject: subscribedFolder
|
||||||
|
inContext: context])
|
||||||
|
[subFolders setObject: subscribedFolder
|
||||||
|
forKey: [subscribedFolder nameInContainer]];
|
||||||
|
else
|
||||||
|
[self _removeSubscribedSource: sourceKey];
|
||||||
|
}
|
||||||
|
|
||||||
- (void) appendSubscribedSources
|
- (void) appendSubscribedSources
|
||||||
{
|
{
|
||||||
NSArray *subscribedReferences;
|
NSArray *subscribedReferences;
|
||||||
NSUserDefaults *settings;
|
NSUserDefaults *settings;
|
||||||
NSEnumerator *allKeys;
|
NSEnumerator *allKeys;
|
||||||
NSString *currentKey;
|
NSString *currentKey;
|
||||||
SOGoGCSFolder *subscribedFolder;
|
|
||||||
|
|
||||||
settings = [[context activeUser] userSettings];
|
settings = [[context activeUser] userSettings];
|
||||||
subscribedReferences = [[settings objectForKey: nameInContainer]
|
subscribedReferences = [[settings objectForKey: nameInContainer]
|
||||||
|
@ -185,19 +210,8 @@
|
||||||
if ([subscribedReferences isKindOfClass: [NSArray class]])
|
if ([subscribedReferences isKindOfClass: [NSArray class]])
|
||||||
{
|
{
|
||||||
allKeys = [subscribedReferences objectEnumerator];
|
allKeys = [subscribedReferences objectEnumerator];
|
||||||
currentKey = [allKeys nextObject];
|
while ((currentKey = [allKeys nextObject]))
|
||||||
while (currentKey)
|
[self _appendSubscribedSource: currentKey];
|
||||||
{
|
|
||||||
subscribedFolder
|
|
||||||
= [subFolderClass folderWithSubscriptionReference: currentKey
|
|
||||||
inContainer: self];
|
|
||||||
if (subscribedFolder)
|
|
||||||
[subFolders setObject: subscribedFolder
|
|
||||||
forKey: [subscribedFolder nameInContainer]];
|
|
||||||
else
|
|
||||||
[self _removeSubscribedSource: currentKey];
|
|
||||||
currentKey = [allKeys nextObject];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue