Monotone-Parent: 41d1207879302957d2bb9e04793e78a7966863a0
Monotone-Revision: dc11ca564098f1f86ef07bafa645a1bc433e3cd7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-06-14T21:23:14 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
2cc3f8684d
commit
777a7f75e7
|
@ -1,3 +1,7 @@
|
||||||
|
2007-06-14 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoLRUCache.m: removed unused module.
|
||||||
|
|
||||||
2007-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2007-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* UI/Scheduler/NSArray+Scheduler.m ([NSArray
|
* UI/Scheduler/NSArray+Scheduler.m ([NSArray
|
||||||
|
|
|
@ -19,21 +19,38 @@
|
||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "SOGoDraftObject.h"
|
#import <Foundation/NSArray.h>
|
||||||
#include <SoObjects/SOGo/WOContext+Agenor.h>
|
#import <Foundation/NSAutoreleasePool.h>
|
||||||
#include <SoObjects/SOGo/NSCalendarDate+SOGo.h>
|
#import <Foundation/NSDictionary.h>
|
||||||
#include <NGMail/NGMimeMessage.h>
|
#import <Foundation/NSKeyValueCoding.h>
|
||||||
#include <NGMail/NGMimeMessageGenerator.h>
|
#import <Foundation/NSUserDefaults.h>
|
||||||
#include <NGMail/NGSendMail.h>
|
#import <Foundation/NSValue.h>
|
||||||
#include <NGMime/NGMimeBodyPart.h>
|
|
||||||
#include <NGMime/NGMimeFileData.h>
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
#include <NGMime/NGMimeMultipartBody.h>
|
#import <NGObjWeb/SoObject+SoDAV.h>
|
||||||
#include <NGMime/NGMimeType.h>
|
#import <NGObjWeb/WOContext.h>
|
||||||
#include <NGMime/NGMimeHeaderFieldGenerator.h>
|
#import <NGObjWeb/WORequest+So.h>
|
||||||
#include <NGImap4/NGImap4Envelope.h>
|
#import <NGObjWeb/WOResponse.h>
|
||||||
#include <NGImap4/NGImap4EnvelopeAddress.h>
|
#import <NGExtensions/NGBase64Coding.h>
|
||||||
#include <NGExtensions/NSFileManager+Extensions.h>
|
#import <NGExtensions/NSFileManager+Extensions.h>
|
||||||
#include "common.h"
|
#import <NGExtensions/NGHashMap.h>
|
||||||
|
#import <NGExtensions/NSNull+misc.h>
|
||||||
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
|
#import <NGExtensions/NGQuotedPrintableCoding.h>
|
||||||
|
#import <NGImap4/NGImap4Envelope.h>
|
||||||
|
#import <NGImap4/NGImap4EnvelopeAddress.h>
|
||||||
|
#import <NGMail/NGMimeMessage.h>
|
||||||
|
#import <NGMail/NGMimeMessageGenerator.h>
|
||||||
|
#import <NGMail/NGSendMail.h>
|
||||||
|
#import <NGMime/NGMimeBodyPart.h>
|
||||||
|
#import <NGMime/NGMimeFileData.h>
|
||||||
|
#import <NGMime/NGMimeMultipartBody.h>
|
||||||
|
#import <NGMime/NGMimeType.h>
|
||||||
|
#import <NGMime/NGMimeHeaderFieldGenerator.h>
|
||||||
|
|
||||||
|
#import <SoObjects/SOGo/NSCalendarDate+SOGo.h>
|
||||||
|
|
||||||
|
#import "SOGoDraftObject.h"
|
||||||
|
|
||||||
static NSString *contentTypeValue = @"text/plain; charset=utf-8";
|
static NSString *contentTypeValue = @"text/plain; charset=utf-8";
|
||||||
|
|
||||||
|
@ -70,7 +87,6 @@ static NSString *userAgent = @"SOGoMail 1.0";
|
||||||
static BOOL draftDeleteDisabled = NO; // for debugging
|
static BOOL draftDeleteDisabled = NO; // for debugging
|
||||||
static BOOL debugOn = NO;
|
static BOOL debugOn = NO;
|
||||||
static BOOL showTextAttachmentsInline = NO;
|
static BOOL showTextAttachmentsInline = NO;
|
||||||
static NSString *fromInternetSuffixPattern = nil;
|
|
||||||
|
|
||||||
+ (int)version {
|
+ (int)version {
|
||||||
return [super version] + 0 /* v1 */;
|
return [super version] + 0 /* v1 */;
|
||||||
|
@ -89,14 +105,6 @@ static NSString *fromInternetSuffixPattern = nil;
|
||||||
if ((draftDeleteDisabled = [ud boolForKey:@"SOGoNoDraftDeleteAfterSend"]))
|
if ((draftDeleteDisabled = [ud boolForKey:@"SOGoNoDraftDeleteAfterSend"]))
|
||||||
NSLog(@"WARNING: draft delete is disabled! (SOGoNoDraftDeleteAfterSend)");
|
NSLog(@"WARNING: draft delete is disabled! (SOGoNoDraftDeleteAfterSend)");
|
||||||
|
|
||||||
fromInternetSuffixPattern = [ud stringForKey:@"SOGoInternetMailSuffix"];
|
|
||||||
if ([fromInternetSuffixPattern length] == 0)
|
|
||||||
NSLog(@"Note: no 'SOGoInternetMailSuffix' is configured.");
|
|
||||||
else {
|
|
||||||
fromInternetSuffixPattern =
|
|
||||||
[@"\n" stringByAppendingString:fromInternetSuffixPattern];
|
|
||||||
}
|
|
||||||
|
|
||||||
TextPlainType = [[NGMimeType mimeType:@"text" subType:@"plain"] copy];
|
TextPlainType = [[NGMimeType mimeType:@"text" subType:@"plain"] copy];
|
||||||
MultiMixedType = [[NGMimeType mimeType:@"multipart" subType:@"mixed"] copy];
|
MultiMixedType = [[NGMimeType mimeType:@"multipart" subType:@"mixed"] copy];
|
||||||
}
|
}
|
||||||
|
@ -341,49 +349,31 @@ static NSString *fromInternetSuffixPattern = nil;
|
||||||
{
|
{
|
||||||
NSDictionary *lInfo;
|
NSDictionary *lInfo;
|
||||||
NGMimeMessage *message;
|
NGMimeMessage *message;
|
||||||
NSString *fromInternetSuffix;
|
|
||||||
BOOL addSuffix;
|
BOOL addSuffix;
|
||||||
id body;
|
id body;
|
||||||
|
|
||||||
if ((lInfo = [self fetchInfo]) == nil)
|
if ((lInfo = [self fetchInfo]) == nil)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
addSuffix = [context isAccessFromIntranet] ? NO : YES;
|
[map setObject: @"text/plain" forKey: @"content-type"];
|
||||||
if (addSuffix) {
|
|
||||||
fromInternetSuffix =
|
|
||||||
[fromInternetSuffixPattern stringByReplacingVariablesWithBindings:
|
|
||||||
[context request]
|
|
||||||
stringForUnknownBindings:@""];
|
|
||||||
|
|
||||||
addSuffix = [fromInternetSuffix length] > 0 ? YES : NO;
|
|
||||||
}
|
|
||||||
|
|
||||||
[map setObject:@"text/plain" forKey:@"content-type"];
|
|
||||||
if ((body = [lInfo objectForKey:@"text"]) != nil) {
|
if ((body = [lInfo objectForKey:@"text"]) != nil) {
|
||||||
if ([body isKindOfClass:[NSString class]]) {
|
if ([body isKindOfClass:[NSString class]])
|
||||||
if (addSuffix)
|
|
||||||
body = [body stringByAppendingString:fromInternetSuffix];
|
|
||||||
|
|
||||||
/* Note: just 'utf8' is displayed wrong in Mail.app */
|
/* Note: just 'utf8' is displayed wrong in Mail.app */
|
||||||
[map setObject: contentTypeValue
|
[map setObject: contentTypeValue
|
||||||
forKey: @"content-type"];
|
forKey: @"content-type"];
|
||||||
// body = [body dataUsingEncoding:NSUTF8StringEncoding];
|
// body = [body dataUsingEncoding:NSUTF8StringEncoding];
|
||||||
}
|
|
||||||
else if ([body isKindOfClass:[NSData class]] && addSuffix) {
|
else if ([body isKindOfClass:[NSData class]] && addSuffix) {
|
||||||
body = [[body mutableCopy] autorelease];
|
body = [[body mutableCopy] autorelease];
|
||||||
[(NSMutableData *)body
|
|
||||||
appendData: [fromInternetSuffix dataUsingEncoding:NSUTF8StringEncoding]];
|
|
||||||
}
|
}
|
||||||
else if (addSuffix) {
|
else if (addSuffix) {
|
||||||
[self warnWithFormat:@"Note: cannot add Internet marker to body: %@",
|
[self warnWithFormat:@"Note: cannot add Internet marker to body: %@",
|
||||||
NSStringFromClass([body class])];
|
NSStringFromClass([body class])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (addSuffix)
|
|
||||||
body = fromInternetSuffix;
|
|
||||||
|
|
||||||
message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
|
message = [[[NGMimeMessage alloc] initWithHeader:map] autorelease];
|
||||||
[message setBody:body];
|
[message setBody:body];
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -934,7 +924,8 @@ static NSString *fromInternetSuffixPattern = nil;
|
||||||
return [NSNumber numberWithBool:YES]; /* delete worked out ... */
|
return [NSNumber numberWithBool:YES]; /* delete worked out ... */
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id)GETAction:(id)_ctx {
|
- (id) GETAction: (id) _ctx
|
||||||
|
{
|
||||||
/*
|
/*
|
||||||
Override, because SOGoObject's GETAction uses the less efficient
|
Override, because SOGoObject's GETAction uses the less efficient
|
||||||
-contentAsString method.
|
-contentAsString method.
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
#include "SOGoUser+Mail.h"
|
#include "SOGoUser+Mail.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include <NGObjWeb/SoObject+SoDAV.h>
|
#include <NGObjWeb/SoObject+SoDAV.h>
|
||||||
#include <SOGo/WOContext+Agenor.h>
|
|
||||||
|
|
||||||
@implementation SOGoMailAccounts
|
@implementation SOGoMailAccounts
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,8 @@
|
||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#warning importing common is baaad
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
#import <Foundation/NSObjCRuntime.h>
|
#import <Foundation/NSObjCRuntime.h>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ libSOGo_HEADER_FILES = \
|
||||||
LDAPUserManager.h \
|
LDAPUserManager.h \
|
||||||
LDAPSource.h \
|
LDAPSource.h \
|
||||||
SOGoPermissions.h \
|
SOGoPermissions.h \
|
||||||
SOGoLRUCache.h \
|
|
||||||
WOContext+Agenor.h \
|
WOContext+Agenor.h \
|
||||||
SOGoDAVRendererTypes.h \
|
SOGoDAVRendererTypes.h \
|
||||||
NSArray+Utilities.h \
|
NSArray+Utilities.h \
|
||||||
|
@ -57,7 +56,6 @@ libSOGo_OBJC_FILES = \
|
||||||
SOGoCustomGroupFolder.m \
|
SOGoCustomGroupFolder.m \
|
||||||
\
|
\
|
||||||
SOGoPermissions.m \
|
SOGoPermissions.m \
|
||||||
SOGoLRUCache.m \
|
|
||||||
LDAPUserManager.m \
|
LDAPUserManager.m \
|
||||||
LDAPSource.m \
|
LDAPSource.m \
|
||||||
WOContext+Agenor.m \
|
WOContext+Agenor.m \
|
||||||
|
|
|
@ -38,17 +38,12 @@
|
||||||
|
|
||||||
@interface SOGoAuthenticator : SoHTTPAuthenticator
|
@interface SOGoAuthenticator : SoHTTPAuthenticator
|
||||||
{
|
{
|
||||||
NSUserDefaults *ud;
|
|
||||||
NSString *authMethod;
|
NSString *authMethod;
|
||||||
NSString *LDAPBaseDN;
|
|
||||||
NSString *LDAPHost;
|
|
||||||
int LDAPPort;
|
int LDAPPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) sharedSOGoAuthenticator;
|
+ (id) sharedSOGoAuthenticator;
|
||||||
|
|
||||||
- (BOOL) LDAPCheckLogin: (NSString *) _login password: (NSString *) _pwd;
|
|
||||||
|
|
||||||
- (SOGoUser *) userInContext: (WOContext *) _ctx;
|
- (SOGoUser *) userInContext: (WOContext *) _ctx;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -30,32 +30,25 @@
|
||||||
|
|
||||||
@implementation SOGoAuthenticator
|
@implementation SOGoAuthenticator
|
||||||
|
|
||||||
static SOGoAuthenticator *auth = nil;
|
|
||||||
|
|
||||||
+ (id) sharedSOGoAuthenticator
|
+ (id) sharedSOGoAuthenticator
|
||||||
{
|
{
|
||||||
if (auth == nil)
|
static SOGoAuthenticator *auth = nil;
|
||||||
auth = [[self alloc] init];
|
|
||||||
|
if (!auth)
|
||||||
|
auth = [self new];
|
||||||
|
|
||||||
return auth;
|
return auth;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
|
NSUserDefaults *ud;
|
||||||
|
|
||||||
if ((self = [super init]))
|
if ((self = [super init]))
|
||||||
{
|
{
|
||||||
ud = [NSUserDefaults standardUserDefaults];
|
ud = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
LDAPBaseDN = nil;
|
|
||||||
LDAPHost = nil;
|
|
||||||
LDAPPort = -1;
|
|
||||||
|
|
||||||
authMethod = [[ud stringForKey:@"AuthentificationMethod"] retain];
|
authMethod = [[ud stringForKey:@"AuthentificationMethod"] retain];
|
||||||
if ([authMethod isEqualToString: @"LDAP"])
|
|
||||||
{
|
|
||||||
// LDAPBaseDN = [[ud stringForKey:@"LDAPRootDN"] retain];
|
|
||||||
// LDAPHost = [[ud stringForKey:@"LDAPHost"] retain];
|
|
||||||
// LDAPPort = [ud integerForKey:@"LDAPPort"];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -63,10 +56,6 @@ static SOGoAuthenticator *auth = nil;
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
if (LDAPBaseDN)
|
|
||||||
[LDAPBaseDN release];
|
|
||||||
if (LDAPHost)
|
|
||||||
[LDAPHost release];
|
|
||||||
[authMethod release];
|
[authMethod release];
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
@ -75,25 +64,19 @@ static SOGoAuthenticator *auth = nil;
|
||||||
password: (NSString *) _pwd
|
password: (NSString *) _pwd
|
||||||
{
|
{
|
||||||
BOOL accept;
|
BOOL accept;
|
||||||
|
LDAPUserManager *um;
|
||||||
|
|
||||||
if ([authMethod isEqualToString: @"LDAP"])
|
if ([authMethod isEqualToString: @"LDAP"])
|
||||||
accept = [self LDAPCheckLogin: _login password: _pwd];
|
{
|
||||||
|
um = [LDAPUserManager sharedUserManager];
|
||||||
|
accept = [um checkLogin: _login andPassword: _pwd];
|
||||||
|
}
|
||||||
else
|
else
|
||||||
accept = ([_login length] > 0);
|
accept = ([_login length] > 0);
|
||||||
|
|
||||||
return (([_login isEqualToString: @"freebusy"]
|
return (accept
|
||||||
&& [_pwd isEqualToString: @"freebusy"])
|
|| ([_login isEqualToString: @"freebusy"]
|
||||||
|| accept);
|
&& [_pwd isEqualToString: @"freebusy"]));
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL) LDAPCheckLogin: (NSString *) _login
|
|
||||||
password: (NSString *) _pwd
|
|
||||||
{
|
|
||||||
LDAPUserManager *um;
|
|
||||||
|
|
||||||
um = [LDAPUserManager sharedUserManager];
|
|
||||||
|
|
||||||
return [um checkLogin: _login andPassword: _pwd];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create SOGoUser */
|
/* create SOGoUser */
|
||||||
|
|
|
@ -1,40 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2000-2004 SKYRIX Software AG
|
|
||||||
|
|
||||||
This file is part of OGo
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef __SOGoLRUCache_H_
|
|
||||||
#define __SOGoLRUCache_H_
|
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
|
|
||||||
@interface SOGoLRUCache : NSObject
|
|
||||||
{
|
|
||||||
unsigned size;
|
|
||||||
NSMutableDictionary *entries;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)initWithCacheSize:(unsigned)_size;
|
|
||||||
|
|
||||||
- (void)addObject:(id)_obj forKey:(id)_key;
|
|
||||||
- (id)objectForKey:(id)_key;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
#endif /* __SOGoLRUCache_H_ */
|
|
|
@ -1,112 +0,0 @@
|
||||||
/*
|
|
||||||
Copyright (C) 2000-2004 SKYRIX Software AG
|
|
||||||
|
|
||||||
This file is part of OGo
|
|
||||||
|
|
||||||
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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "SOGoLRUCache.h"
|
|
||||||
#include "common.h"
|
|
||||||
|
|
||||||
@interface SOGoLRUCacheItem : NSObject
|
|
||||||
{
|
|
||||||
id object;
|
|
||||||
unsigned useCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)initWithObject:(id)_obj;
|
|
||||||
- (id)object;
|
|
||||||
|
|
||||||
- (unsigned)useCount;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation SOGoLRUCacheItem
|
|
||||||
|
|
||||||
- (id)initWithObject:(id)_obj {
|
|
||||||
self = [super init];
|
|
||||||
if(self) {
|
|
||||||
ASSIGN(self->object, _obj);
|
|
||||||
self->useCount = 1;
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)object {
|
|
||||||
self->useCount++;
|
|
||||||
return self->object;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (unsigned)useCount {
|
|
||||||
return self->useCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation SOGoLRUCache
|
|
||||||
|
|
||||||
- (id)initWithCacheSize:(unsigned)_size {
|
|
||||||
self = [super init];
|
|
||||||
if(self) {
|
|
||||||
self->size = _size;
|
|
||||||
self->entries = [[NSMutableDictionary alloc] initWithCapacity:_size];
|
|
||||||
}
|
|
||||||
return self;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)dealloc {
|
|
||||||
[self->entries release];
|
|
||||||
[super dealloc];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (void)addObject:(id)_obj forKey:(id)_key {
|
|
||||||
SOGoLRUCacheItem *item;
|
|
||||||
|
|
||||||
NSAssert(_obj, @"Attempt to insert nil object!");
|
|
||||||
|
|
||||||
if([self->entries count] >= self->size) {
|
|
||||||
/* need to find minimum and get rid of it */
|
|
||||||
NSEnumerator *keyEnum;
|
|
||||||
SOGoLRUCacheItem *item;
|
|
||||||
id key, leastUsedItemKey;
|
|
||||||
unsigned minimumUseCount = INT_MAX;
|
|
||||||
|
|
||||||
keyEnum = [self->entries keyEnumerator];
|
|
||||||
while((key = [keyEnum nextObject])) {
|
|
||||||
item = [self->entries objectForKey:key];
|
|
||||||
if([item useCount] < minimumUseCount) {
|
|
||||||
minimumUseCount = [item useCount];
|
|
||||||
leastUsedItemKey = key;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
[self->entries removeObjectForKey:leastUsedItemKey];
|
|
||||||
}
|
|
||||||
item = [[SOGoLRUCacheItem alloc] initWithObject:_obj];
|
|
||||||
[self->entries setObject:item forKey:_key];
|
|
||||||
[item release];
|
|
||||||
}
|
|
||||||
|
|
||||||
- (id)objectForKey:(id)_key {
|
|
||||||
SOGoLRUCacheItem *item;
|
|
||||||
|
|
||||||
item = [self->entries objectForKey:_key];
|
|
||||||
if(!item)
|
|
||||||
return nil;
|
|
||||||
return [item object];
|
|
||||||
}
|
|
||||||
|
|
||||||
@end
|
|
|
@ -19,8 +19,8 @@
|
||||||
02111-1307, USA.
|
02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "WOContext+Agenor.h"
|
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
#import "SOGoUser.h"
|
#import "SOGoUser.h"
|
||||||
|
|
||||||
#import "Appointments/SOGoAppointmentFolder.h"
|
#import "Appointments/SOGoAppointmentFolder.h"
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
*/
|
*/
|
||||||
// $Id: common.h 96 2004-06-30 08:35:34Z helge $
|
// $Id: common.h 96 2004-06-30 08:35:34Z helge $
|
||||||
|
|
||||||
|
#warning importing common is baaad
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
|
#if NeXT_Foundation_LIBRARY || COCOA_Foundation_LIBRARY
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
#import <SoObjects/Mailer/SOGoMailAccounts.h>
|
#import <SoObjects/Mailer/SOGoMailAccounts.h>
|
||||||
#import <SoObjects/Mailer/SOGoMailIdentity.h>
|
#import <SoObjects/Mailer/SOGoMailIdentity.h>
|
||||||
#import <SoObjects/SOGo/SOGoUser.h>
|
#import <SoObjects/SOGo/SOGoUser.h>
|
||||||
#import <SoObjects/SOGo/WOContext+Agenor.h>
|
|
||||||
#import <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -226,19 +225,6 @@ static NSArray *infoKeys = nil;
|
||||||
return [self labelForKey:@"Compose Mail"];
|
return [self labelForKey:@"Compose Mail"];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* detect webmail being accessed from the outside */
|
|
||||||
|
|
||||||
- (BOOL)isInternetRequest {
|
|
||||||
// DEPRECATED
|
|
||||||
return [[self context] isAccessFromIntranet] ? NO : YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
- (BOOL)showInternetMarker {
|
|
||||||
if (!showInternetMarker)
|
|
||||||
return NO;
|
|
||||||
return [[self context] isAccessFromIntranet] ? NO : YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* info loading */
|
/* info loading */
|
||||||
|
|
||||||
- (void)loadInfo:(NSDictionary *)_info {
|
- (void)loadInfo:(NSDictionary *)_info {
|
||||||
|
@ -507,7 +493,6 @@ static NSArray *infoKeys = nil;
|
||||||
{
|
{
|
||||||
NSException *error;
|
NSException *error;
|
||||||
NSString *mailPath;
|
NSString *mailPath;
|
||||||
NSDictionary *h;
|
|
||||||
id <WOActionResults> result;
|
id <WOActionResults> result;
|
||||||
|
|
||||||
// TODO: need to validate whether we have a To etc
|
// TODO: need to validate whether we have a To etc
|
||||||
|
@ -529,12 +514,10 @@ static NSArray *infoKeys = nil;
|
||||||
|
|
||||||
/* setup some extra headers if required */
|
/* setup some extra headers if required */
|
||||||
|
|
||||||
h = [[self context] isAccessFromIntranet] ? nil : internetMailHeaders;
|
|
||||||
|
|
||||||
/* save mail to file (so that we can upload the mail to Cyrus) */
|
/* save mail to file (so that we can upload the mail to Cyrus) */
|
||||||
// TODO: all this could be handled by the SOGoDraftObject?
|
// TODO: all this could be handled by the SOGoDraftObject?
|
||||||
|
|
||||||
mailPath = [[self clientObject] saveMimeMessageToTemporaryFileWithHeaders:h];
|
mailPath = [[self clientObject] saveMimeMessageToTemporaryFileWithHeaders: internetMailHeaders];
|
||||||
|
|
||||||
/* then, send mail */
|
/* then, send mail */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue