mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 23:07:12 +00:00
Monotone-Parent: 5f1640d17dbc95901d131c16f8d4499aa044594c
Monotone-Revision: 0bbbd12ea5011c00d28bdc2f4c9377a886d244e0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-12-08T23:18:12 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
e361b6615f
commit
af7f0ba0e4
6 files changed
+92
-25
No files matched your search
@@ -22,6 +22,10 @@
|
||||
SOGoSMTPServer = "localhost";
|
||||
SOGoMailSpoolPath = "/tmp";
|
||||
|
||||
SOGoWebAccessEnabled = YES;
|
||||
SOGoCalendarDAVAccessEnabled = YES;
|
||||
SOGoAddressBookDAVAccessEnabled = YES;
|
||||
|
||||
SOGoLoginModule = "Mail";
|
||||
SOGoLanguage = "English";
|
||||
SOGoSupportedLanguages = ( "Czech", "Welsh", "English", "Spanish",
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
- (BOOL) trustProxyAuthentication;
|
||||
- (BOOL) useRelativeURLs;
|
||||
|
||||
- (BOOL) isWebAccessEnabled;
|
||||
- (BOOL) isCalendarDAVAccessEnabled;
|
||||
- (BOOL) isAddressBookDAVAccessEnabled;
|
||||
|
||||
- (NSString *) faviconRelativeURL;
|
||||
- (NSString *) zipPath;
|
||||
- (int) port;
|
||||
|
||||
@@ -205,6 +205,21 @@ BootstrapNSUserDefaults ()
|
||||
return [self boolForKey: @"WOUseRelativeURLs"];
|
||||
}
|
||||
|
||||
- (BOOL) isWebAccessEnabled
|
||||
{
|
||||
return [self boolForKey: @"SOGoWebAccessEnabled"];
|
||||
}
|
||||
|
||||
- (BOOL) isCalendarDAVAccessEnabled
|
||||
{
|
||||
return [self boolForKey: @"SOGoCalendarDAVAccessEnabled"];
|
||||
}
|
||||
|
||||
- (BOOL) isAddressBookDAVAccessEnabled
|
||||
{
|
||||
return [self boolForKey: @"SOGoAddressBookDAVAccessEnabled"];
|
||||
}
|
||||
|
||||
- (NSString *) faviconRelativeURL
|
||||
{
|
||||
return [self stringForKey: @"SOGoFaviconRelativeURL"];
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#import <NGObjWeb/WOApplication.h>
|
||||
#import <NGObjWeb/WOContext+SoObjects.h>
|
||||
#import <NGObjWeb/WORequest.h>
|
||||
#import <NGObjWeb/WORequest+So.h>
|
||||
#import <NGObjWeb/WOResponse.h>
|
||||
|
||||
#import <NGExtensions/NSObject+Logs.h>
|
||||
@@ -53,6 +54,7 @@
|
||||
#import "NSDictionary+Utilities.h"
|
||||
#import "SOGoUserManager.h"
|
||||
#import "SOGoPermissions.h"
|
||||
#import "SOGoSystemDefaults.h"
|
||||
#import "SOGoUser.h"
|
||||
#import "WORequest+SOGo.h"
|
||||
|
||||
@@ -66,11 +68,16 @@
|
||||
{
|
||||
NSMutableArray *children;
|
||||
SOGoUser *currentUser;
|
||||
BOOL isDAVRequest;
|
||||
SOGoSystemDefaults *sd;
|
||||
|
||||
children = [NSMutableArray arrayWithCapacity: 4];
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
isDAVRequest = [[context request] isSoWebDAVRequest];
|
||||
currentUser = [context activeUser];
|
||||
if ([currentUser canAccessModule: @"Calendar"])
|
||||
if ((!isDAVRequest || [sd isCalendarDAVAccessEnabled])
|
||||
&& [currentUser canAccessModule: @"Calendar"])
|
||||
{
|
||||
[children addObject: @"Calendar"];
|
||||
/* support for caldav-proxy, which is currently limited to iCal but may
|
||||
@@ -82,7 +89,8 @@
|
||||
[children addObject: @"calendar-proxy-read"];
|
||||
}
|
||||
}
|
||||
[children addObject: @"Contacts"];
|
||||
if (isDAVRequest && [sd isAddressBookDAVAccessEnabled])
|
||||
[children addObject: @"Contacts"];
|
||||
if ([currentUser canAccessModule: @"Mail"])
|
||||
[children addObject: @"Mail"];
|
||||
// [children addObject: @"Preferences"];
|
||||
@@ -543,15 +551,20 @@
|
||||
inContext: (WOContext *) _ctx
|
||||
acquire: (BOOL) _flag
|
||||
{
|
||||
id obj;
|
||||
SOGoUser *currentUser;
|
||||
BOOL isDAVRequest;
|
||||
SOGoSystemDefaults *sd;
|
||||
id obj;
|
||||
|
||||
/* first check attributes directly bound to the application */
|
||||
obj = [super lookupName: _key inContext: _ctx acquire: NO];
|
||||
if (!obj)
|
||||
{
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
isDAVRequest = [[context request] isSoWebDAVRequest];
|
||||
currentUser = [_ctx activeUser];
|
||||
if ([currentUser canAccessModule: @"Calendar"])
|
||||
if ((!isDAVRequest || [sd isCalendarDAVAccessEnabled])
|
||||
&& [currentUser canAccessModule: @"Calendar"])
|
||||
{
|
||||
if ([_key isEqualToString: @"Calendar"])
|
||||
obj = [self privateCalendars: @"Calendar" inContext: _ctx];
|
||||
@@ -568,7 +581,9 @@
|
||||
&& [currentUser canAccessModule: @"Mail"])
|
||||
obj = [self mailAccountsFolder: _key inContext: _ctx];
|
||||
|
||||
if (!obj && [_key isEqualToString: @"Contacts"])
|
||||
if (!obj
|
||||
&& [_key isEqualToString: @"Contacts"]
|
||||
&& (isDAVRequest && [sd isAddressBookDAVAccessEnabled]))
|
||||
obj = [self privateContacts: _key inContext: _ctx];
|
||||
|
||||
// else if ([_key isEqualToString: @"Preferences"])
|
||||
@@ -586,10 +601,20 @@
|
||||
|
||||
- (NSArray *) fetchContentObjectNames
|
||||
{
|
||||
SOGoSystemDefaults *sd;
|
||||
SOGoUser *currentUser;
|
||||
static NSArray *cos = nil;
|
||||
|
||||
if (!cos)
|
||||
cos = [[NSArray alloc] initWithObjects: @"freebusy.ifb", nil];
|
||||
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
currentUser = [context activeUser];
|
||||
if ((![[context request] isSoWebDAVRequest] || [sd isCalendarDAVAccessEnabled])
|
||||
&& [currentUser canAccessModule: @"Calendar"])
|
||||
{
|
||||
if (!cos)
|
||||
cos = [[NSArray alloc] initWithObjects: @"freebusy.ifb", nil];
|
||||
}
|
||||
else
|
||||
cos = [NSArray array];
|
||||
|
||||
return cos;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user