+2008-02-07 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/SOGo/SOGoUserFolder.m ([-login]): removed useless
+ method.
+ ([SOGoUserFolder -ownerInContext:_ctx]): compute the owner name
+ from a SOGoUser instance initialized with the nameInContainer as
+ initial login name. This way, all the objects belonging to the
+ corresponding user will be accessible with all the fields
+ mentionned in the "bindFields" LDAP settings value.
+ ([SOGoUserFolder -privateCalendars:keyinContext:localContext])
+ ([SOGoUserFolder -privateContacts:_keyinContext:_ctx]): use -[self
+ ownerInContext:] to determine the OCS path.
+
+ * SoObjects/Mailer/SOGoSharedMailAccount.[hm]: removed useless
+ module.
+
+ * SoObjects/Mailer/SOGoSharedInboxFolder.[hm]: removed useless
+ module.
+
+ * UI/PreferencesUI/UIxPreferences.m ([UIxPreferences
+ -setSignature:newSignature]): invoke -[SOGoUser saveMailAccounts]
+
+ * SoObjects/SOGo/SOGoUser.m ([SOGoUser -defaultIdentity]): method
+ moved from UIxPreferences.m.
+ ([SOGoUser -saveMailAccounts]): new methods that save the
+ "MailAccounts" preference in the user settings.
+
+ * SoObjects/SOGo/LDAPUserManager.m ([LDAPUserManager
+ +initialize]): issue a warning whenever "SOGoDefaultMailDomain"
+ is not configured in the user defaults, setting it to "localhost"
+ by default.
+ ([LDAPUserManager +defaultMailDomainIsConfigured]): new method
+ that returns whether "SOGoDefaultMailDomain" is configured.
+
+2008-02-06 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder -ocsFolder]):
+ send an email only when not in a dav request.
+ ([SOGoGCSFolder -delete]): same as above.
+
+ * SoObjects/Mailer/SOGoMailAccount.m ([SOGoMailAccount
+ -supportsQuotas]): test quota support by querying the server
+ capability.
+
2008-02-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
- * UI/MailPartViewers/UIxMailPartICalActions.m ([UIxMailPartICalActions -acceptAction])
+ * UI/MailPartViewers/UIxMailPartICalActions.m
+ ([UIxMailPartICalActions -acceptAction])
([UIxMailPartICalActions -declineAction]): define the organizer of
the event as one of the reply-to or from addresses whenever the
organizer is not specified in those Outlook invitations.
SOGoMailBaseObject.m \
SOGoMailAccounts.m \
SOGoMailAccount.m \
- SOGoSharedMailAccount.m \
SOGoMailFolder.m \
- SOGoSharedInboxFolder.m \
SOGoMailObject.m \
SOGoDraftObject.m \
SOGoMailObject+Draft.m \
- (BOOL) supportsQuotas
{
NGImap4Client *imapClient;
+ NSArray *capability;
imapClient = [[self imap4Connection] client];
+ capability = [[imapClient capability] objectForKey: @"capability"];
- return [[imapClient context] canQuota];
+ return [capability containsObject: @"quota"];
}
/* hierarchy */
#import "../SOGo/NSArray+Utilities.h"
#import "../SOGo/SOGoUser.h"
+#import "SOGoMailAccount.h"
#import "SOGoMailAccounts.h"
@implementation SOGoMailAccounts
-static NSString *AgenorShareLoginMarker = @".-.";
-
/* listing the available mailboxes */
-- (BOOL) isInHomeFolderBranchOfLoggedInAccount: (NSString *) userLogin
-{
- return [[container nameInContainer] isEqualToString: userLogin];
-}
+// - (BOOL) isInHomeFolderBranchOfLoggedInAccount: (NSString *) userLogin
+// {
+// return [[container nameInContainer] isEqualToString: userLogin];
+// }
- (NSArray *) toManyRelationshipKeys
{
return [[accounts objectsForKey: @"name"] containsObject: _key];
}
-- (id) mailAccountWithName: (NSString *) _key
- inContext: (id) _ctx
-{
- static Class ctClass = Nil;
- id ct;
+// - (id) mailAccountWithName: (NSString *) _key
+// inContext: (id) _ctx
+// {
+// static Class ctClass = Nil;
+// id ct;
- if (ctClass == Nil)
- ctClass = NSClassFromString(@"SOGoMailAccount");
- if (ctClass == Nil) {
- [self errorWithFormat:@"missing SOGoMailAccount class!"];
- return nil;
- }
+// if (ctClass == Nil)
+// ctClass = NSClassFromString(@"SOGoMailAccount");
+// if (ctClass == Nil) {
+// [self errorWithFormat:@"missing SOGoMailAccount class!"];
+// return nil;
+// }
- ct = [[ctClass alloc] initWithName:_key inContainer:self];
-
- return [ct autorelease];
-}
-
-- (id) sharedMailAccountWithName: (NSString *) _key
- inContext: (id) _ctx
-{
- static Class ctClass = Nil;
+// ct = [[ctClass alloc] initWithName:_key inContainer:self];
- if (ctClass == Nil)
- ctClass = NSClassFromString (@"SOGoSharedMailAccount");
- if (ctClass == Nil)
- [self errorWithFormat:@"missing SOGoSharedMailAccount class!"];
-
- return [ctClass objectWithName: _key inContainer: self];
-}
+// return [ct autorelease];
+// }
- (id) lookupName: (NSString *) _key
inContext: (id) _ctx
acquire: (BOOL) _flag
{
id obj;
- NSString *userLogin;
-
- userLogin = [[context activeUser] login];
-
- /* first check attributes directly bound to the application */
- if ((obj = [super lookupName:_key inContext:_ctx acquire:NO]))
- return obj;
+// NSString *userLogin;
- if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
- [self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@",
- userLogin, [container nameInContainer]];
-
- return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
- reason:@"Tried to access the mail of another user"];
- }
+// userLogin = [[context activeUser] login];
- if ([self isValidMailAccountName:_key]) {
- BOOL isSharedKey;
+// if (![self isInHomeFolderBranchOfLoggedInAccount: userLogin]) {
+// [self warnWithFormat:@ "User %@ tried to access mail hierarchy of %@",
+// userLogin, [container nameInContainer]];
- isSharedKey = [_key rangeOfString:AgenorShareLoginMarker].length > 0;
-
- return isSharedKey
- ? [self sharedMailAccountWithName:_key inContext:_ctx]
- : [self mailAccountWithName:_key inContext:_ctx];
- }
+// return [NSException exceptionWithHTTPStatus:403 /* Forbidden */
+// reason:@"Tried to access the mail of another user"];
+// }
+
- /* return 404 to stop acquisition */
- return [NSException exceptionWithHTTPStatus:404 /* Not Found */];
+ /* first check attributes directly bound to the application */
+ obj = [super lookupName:_key inContext:_ctx acquire:NO];
+ if (!obj)
+ {
+ if ([self isValidMailAccountName: _key])
+ obj = [SOGoMailAccount objectWithName: _key inContainer: self];
+ else
+ obj = [NSException exceptionWithHTTPStatus: 404 /* Not Found */];
+ }
+
+ return obj;
}
@end /* SOGoMailAccounts */
{
NSURL *url;
- if ([container respondsToSelector:@selector(imap4URL)])
+ if ([container respondsToSelector: @selector(imap4URL)])
url = [container imap4URL];
else
{
+++ /dev/null
-/*
- 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.
-*/
-
-#ifndef __Mailer_SOGoSharedInboxFolder_H__
-#define __Mailer_SOGoSharedInboxFolder_H__
-
-#import <SoObjects/Mailer/SOGoMailFolder.h>
-
-/*
- SOGoSharedInboxFolder
- Parent object: the SOGoSharedMailAccount
- Child objects: SOGoMailObject or SOGoMailFolder
-
- The SOGoSharedInboxFolder is a special SOGoMailFolder for use as the INBOX
- og SOGoSharedMailAccounts. This is necessary because the INBOX location in
- the IMAP4 server is different for shared boxes (its the shared user folder,
- not a mapped subfolder).
-*/
-
-@interface SOGoSharedInboxFolder : SOGoMailFolder
-{
-}
-
-@end
-
-#endif /* __Mailer_SOGoSharedInboxFolder_H__ */
+++ /dev/null
-/*
- 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.
-*/
-
-#import "SOGoSharedInboxFolder.h"
-
-@implementation SOGoSharedInboxFolder
-
-/* listing available folders */
-
-- (NSArray *)toManyRelationshipKeys {
- /*
- A shared INBOX has no subfolders because those are already shown as
- subfolders of the account.
- */
- return nil;
-}
-
-/* IMAP4 locator */
-
-- (NSURL *)imap4URL {
- return [[self container] imap4URL];
-}
-
-@end /* SOGoSharedInboxFolder */
+++ /dev/null
-/*
- Copyright (C) 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.
-*/
-
-#ifndef __Mailer_SOGoSharedMailAccount_H__
-#define __Mailer_SOGoSharedMailAccount_H__
-
-#include <SoObjects/Mailer/SOGoMailAccount.h>
-
-/*
- SOGoSharedMailAccount
- Parent object: SOGoMailAccounts
- Child objects: SOGoMailFolder
-
- The SOGoSharedMailAccount represents an IMAP4 mail account which is shared
- by multiple users using the ".-." login trick.
-
- Eg:
- beatrix.b.-.evariste.e@amelie-01.ac.melanie2.i2
-
- The mailbox of 'evariste.e' will be accessed using as user 'beatrix.b'. The
- Cyrus server will deliver a special kind of mailbox hierarchy in this case.
-
- An advantage is that either Cyrus or LDAP seems to know about the ".-."
- separator.
-*/
-
-@class NSString;
-
-@interface SOGoSharedMailAccount : SOGoMailAccount
-{
-}
-
-- (BOOL)isSharedAccount;
-- (NSString *)sharedAccountName;
-
-@end
-
-#endif /* __Mailer_SOGoSharedMailAccount_H__ */
+++ /dev/null
-/*
- Copyright (C) 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.
-*/
-
-#import <Foundation/NSArray.h>
-#import <Foundation/NSString.h>
-#import <Foundation/NSUserDefaults.h>
-
-#import <NGImap4/NGImap4Connection.h>
-
-#import "SOGoSharedMailAccount.h"
-
-@interface SOGoMailAccount(UsedPrivates)
-
-- (NSString *)imap4URLString;
-
-- (id)lookupFolder:(NSString *)_key ofClassNamed:(NSString *)_cn
- inContext:(id)_cx;
-
-@end
-
-@implementation SOGoSharedMailAccount
-
-static NSString *otherUsersFolderName = @""; // TODO: add English default
-
-+ (void) initialize
-{
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
-
- otherUsersFolderName = [ud stringForKey:@"SOGoOtherUsersFolderName"];
- NSLog(@"Note: using other-users-folders name: '%@'", otherUsersFolderName);
-}
-
-/* shared accounts */
-
-- (BOOL)isSharedAccount {
- return YES;
-}
-
-- (NSString *)sharedAccountName {
- NSString *s;
- NSRange r;
-
- s = [self nameInContainer];
- r = [s rangeOfString:@"@"];
- if (r.length == 0) /* regular HTTP logins are never a shared mailbox */
- return nil;
-
- s = [s substringToIndex:r.location];
- r = [s rangeOfString:@".-."];
- if (r.length == 0) /* no shared mailbox marker */
- return nil;
-
- return [s substringFromIndex:(r.location + r.length)];
-}
-
-/* listing the available folders */
-
-- (NSArray *)additionalRootFolderNames {
- /* do not show Drafts folder in shared mailboxes (#1452) */
- /* Note: this also disables the Sieve folder */
- return nil;
-}
-
-- (NSArray *)toManyRelationshipKeys {
- NSMutableArray *m;
- NSArray *b;
-
- m = [NSMutableArray arrayWithCapacity:16];
-
- [m addObject:@"INBOX"]; /* special for shared, see -lookupInboxFolder:.. */
-
- if ((b = [[self imap4Connection] subfoldersForURL:[self imap4URL]]) != nil)
- [m addObjectsFromArray:b];
-
- if ((b = [self additionalRootFolderNames]) != nil)
- [m addObjectsFromArray:b];
- return m;
-}
-
-/* IMAP4 locator */
-
-- (NSString *)imap4URLString {
- /* we jump in the hierarchy directly to the shared user folder */
- NSString *s;
-
- s = [super imap4URLString];
- s = [s stringByAppendingString:otherUsersFolderName];
- s = [s stringByAppendingString:@"/"];
- s = [s stringByAppendingString:[self sharedAccountName]];
- return s;
-}
-
-/* lookup */
-
-- (id)lookupInboxFolder:(NSString *)_key inContext:(id)_ctx {
- /*
- Note: We have a choice: Cyrus does both, it gives the user an own
- INBOX folder, but it also provides access to the mailbox INBOX
- folder.
- However the mailbox INBOX folder is NOT returned as an "INBOX"
- subcollection as usual, but is the primary mailbox name.
- Eg:
- 2 list "*" "*"
- * LIST (\Noinferiors) "/" "INBOX"
- * LIST (\HasChildren) "/" "Boite partag&AOk-e/alienor.a"
-
- The first INBOX is auto-assigned for the user by Cyrus, the second entry
- is actually the INBOX of the mailbox itself (alienor.a).
- */
- return [self lookupFolder:_key ofClassNamed:@"SOGoSharedInboxFolder"
- inContext:_ctx];
-}
-
-- (id)lookupName:(NSString *)_key inContext:(id)_ctx acquire:(BOOL)_flag {
- if ([_key isEqualToString:@"INBOX"])
- return [self lookupInboxFolder:_key inContext:_ctx];
-
- return [super lookupName:_key inContext:_ctx acquire:_flag];
-}
-
-@end /* SOGoSharedMailAccount */
"WebDAV Access" = ( "Owner", "AuthorizedSubscriber" );
};
};
- SOGoSharedMailAccount = {
+/* SOGoSharedMailAccount = {
superclass = "SOGoMailAccount";
- };
+ }; */
SOGoMailFolder = {
superclass = "SOGoMailBaseObject";
defaultRoles = {
"SaveAcls" = ( "Owner", "MailAdministrator" );
};
};
- SOGoSharedInboxFolder = {
+/* SOGoSharedInboxFolder = {
superclass = "SOGoMailFolder";
- };
+ }; */
SOGoTrashFolder = {
superclass = "SOGoMailFolder";
};
+ (id) sharedUserManager;
++ (BOOL) defaultMailDomainIsConfigured;
+
- (NSArray *) sourceIDs;
- (NSDictionary *) metadataForSourceID: (NSString *) sourceID;
- (NSArray *) authenticationSourceIDs;
#import <Foundation/NSTimer.h>
#import <Foundation/NSUserDefaults.h>
#import <Foundation/NSValue.h>
+#import <NGExtensions/NSObject+Logs.h>
#import "NSArray+Utilities.h"
#import "LDAPSource.h"
#import "LDAPUserManager.h"
static NSString *defaultMailDomain = nil;
+static BOOL defaultMailDomainIsConfigured = NO;
@implementation LDAPUserManager
{
defaultMailDomain = [ud stringForKey: @"SOGoDefaultMailDomain"];
[defaultMailDomain retain];
+ defaultMailDomainIsConfigured = YES;
}
+ if (!defaultMailDomain)
+ {
+ [self warnWithFormat:
+ @"no domain specified for SOGoDefaultMailDomain,"
+ @" value set to 'localhost'"];
+ defaultMailDomain = @"localhost";
+ }
+}
+
++ (BOOL) defaultMailDomainIsConfigured
+{
+ return defaultMailDomainIsConfigured;
}
+ (id) sharedUserManager
- (NSArray *) aclsForUser: (NSString *) uid
{
NSMutableArray *acls;
- NSArray *ownAcls, *containerAcls;
+ NSArray *containerAcls;
acls = [NSMutableArray array];
/* this is unused... */
#import "SOGoParentFolder.h"
#import "SOGoPermissions.h"
#import "SOGoUser.h"
+#import "WORequest+SOGo.h"
#import "SOGoGCSFolder.h"
withName: displayName
atPath: ocsPath];
- if (!result && sendFolderAdvisories) [self sendFolderAdvisoryTemplate: @"Addition"];
+ if (!result
+ && [[context request] handledByDefaultHandler]
+ && sendFolderAdvisories)
+ [self sendFolderAdvisoryTemplate: @"Addition"];
return (result == nil);
}
else
error = [[self folderManager] deleteFolderAtPath: ocsPath];
- if (!error && sendFolderAdvisories) [self sendFolderAdvisoryTemplate: @"Removal"];
+ if (!error && sendFolderAdvisories
+ && [[context request] handledByDefaultHandler])
+ [self sendFolderAdvisoryTemplate: @"Removal"];
return error;
}
+ (SOGoUser *) userWithLogin: (NSString *) login
roles: (NSArray *) roles;
+
+- (void) setPrimaryRoles: (NSArray *) newRoles;
+
- (void) setCurrentPassword: (NSString *) newPassword;
- (NSString *) currentPassword;
- (NSArray *) mailAccounts;
- (NSArray *) allIdentities;
- (NSDictionary *) primaryIdentity;
+- (NSMutableDictionary *) defaultIdentity;
- (NSString *) messageForwarding;
- (NSString *) messageCheck;
- (NSString *) signature;
+- (void) saveMailAccounts;
+
- (BOOL) isSuperUser;
/* module access */
#import <NGObjWeb/WORequest.h>
#import <NGObjWeb/SoObject.h>
#import <NGExtensions/NSNull+misc.h>
+#import <NGExtensions/NSObject+Logs.h>
#import "AgenorUserDefaults.h"
#import "LDAPUserManager.h"
static NSTimeZone *serverTimeZone = nil;
static NSString *fallbackIMAP4Server = nil;
+static BOOL fallbackIsConfigured = NO;
static NSString *defaultLanguage = nil;
static NSArray *superUsernames = nil;
static NSURL *AgenorProfileURL = nil;
if (!fallbackIMAP4Server)
ASSIGN (fallbackIMAP4Server,
[ud stringForKey: @"SOGoFallbackIMAP4Server"]);
+ if (fallbackIMAP4Server)
+ fallbackIsConfigured = YES;
+ else
+ {
+ [self warnWithFormat:
+ @"no server specified for SOGoFallbackIMAP4Server,"
+ @" value set to 'localhost'"];
+ fallbackIMAP4Server = @"localhost";
+ }
+
if (!defaultLanguage)
{
ASSIGN (defaultLanguage, [ud stringForKey: @"SOGoDefaultLanguage"]);
return lng;
}
++ (NSString *) fallbackIMAP4Server
+{
+ return fallbackIMAP4Server;
+}
+
+ (SOGoUser *) userWithLogin: (NSString *) newLogin
roles: (NSArray *) newRoles
{
realUID = [[um contactInfosForUserWithUIDorEmail: newLogin]
objectForKey: @"c_uid"];
}
+
if (realUID)
self = [super initWithLogin: realUID roles: newRoles];
else
return cn;
}
+- (NSMutableDictionary *) defaultIdentity
+{
+ NSMutableDictionary *currentIdentity, *defaultIdentity;
+ NSEnumerator *identities;
+
+ defaultIdentity = nil;
+
+ identities = [[self allIdentities] objectEnumerator];
+ while (!defaultIdentity
+ && (currentIdentity = [identities nextObject]))
+ if ([[currentIdentity objectForKey: @"isDefault"] boolValue])
+ defaultIdentity = currentIdentity;
+
+ return defaultIdentity;
+}
+
+- (void) saveMailAccounts
+{
+ BOOL doSave;
+
+ doSave = YES;
+ if (!fallbackIsConfigured)
+ {
+ [self logWithFormat: @"'SOGoFallbackIMAP4Server' is not set"];
+ doSave = NO;
+ }
+ if (![LDAPUserManager defaultMailDomainIsConfigured])
+ {
+ [self logWithFormat: @"'SOGoDefaultMailDomain' is not set"];
+ doSave = NO;
+ }
+ if (doSave)
+ [userDefaults setObject: [self mailAccounts]
+ forKey: @"MailAccounts"];
+ else
+ [self logWithFormat: @"saving mail accounts is disabled until the"
+ @" variable(s) mentionned above are configured"];
+}
+
// - (NSString *) primaryMailServer
// {
// return [[self userManager] getServerForUID: [self login]];
@interface SOGoUserFolder : SOGoFolder
-/* accessors */
-
-- (NSString *) login;
-
/* ownership */
- (NSString *) ownerInContext: (WOContext *) _ctx;
// [sInfo declareRoles: basicRoles asDefaultForPermission: SoPerm_WebDAVAccess];
// }
-/* accessors */
-
-- (NSString *) login
-{
- return nameInContainer;
-}
-
/* hierarchy */
- (NSArray *) toManyRelationshipKeys
- (NSString *) ownerInContext: (WOContext *) _ctx
{
- return nameInContainer;
+ SOGoUser *ownerUser;
+
+ if (!owner)
+ {
+ ownerUser = [SOGoUser userWithLogin: nameInContainer roles: nil];
+ owner = [ownerUser login];
+ }
+
+ return owner;
}
/* looking up shared objects */
// : [super permissionForKey: key]);
// }
-- (SOGoAppointmentFolders *) privateCalendars: (NSString *) _key
- inContext: (WOContext *) _ctx
+- (SOGoAppointmentFolders *) privateCalendars: (NSString *) key
+ inContext: (WOContext *) localContext
{
SOGoAppointmentFolders *calendars;
-
- calendars = [$(@"SOGoAppointmentFolders") objectWithName: _key inContainer: self];
- [calendars setBaseOCSPath: [NSString stringWithFormat: @"/Users/%@/Calendar",
- nameInContainer]];
+ NSString *baseOCSPath;
+
+ calendars = [$(@"SOGoAppointmentFolders") objectWithName: key
+ inContainer: self];
+ baseOCSPath = [NSString stringWithFormat: @"/Users/%@/Calendar",
+ [self ownerInContext: nil]];
+ [calendars setBaseOCSPath: baseOCSPath];
return calendars;
}
inContext: (WOContext *) _ctx
{
SOGoContactFolders *contacts;
+ NSString *baseOCSPath;
contacts = [$(@"SOGoContactFolders") objectWithName:_key inContainer: self];
- [contacts setBaseOCSPath: [NSString stringWithFormat: @"/Users/%@/Contacts",
- nameInContainer]];
+ baseOCSPath = [NSString stringWithFormat: @"/Users/%@/Contacts",
+ [self ownerInContext: nil]];
+ [contacts setBaseOCSPath: baseOCSPath];
return contacts;
}
return [(NSDictionary *) item keysWithFormat: @"%{fullName} <%{email}>"];
}
-- (NSMutableDictionary *) defaultIdentity
-{
- NSMutableDictionary *currentIdentity, *defaultIdentity;
- NSEnumerator *identities;
-
- defaultIdentity = nil;
-
- identities = [[user allIdentities] objectEnumerator];
- while (!defaultIdentity
- && (currentIdentity = [identities nextObject]))
- if ([[currentIdentity objectForKey: @"isDefault"] boolValue])
- defaultIdentity = currentIdentity;
-
- return defaultIdentity;
-}
-
- (NSString *) signature
{
- return [[self defaultIdentity] objectForKey: @"signature"];
+ return [[user defaultIdentity] objectForKey: @"signature"];
}
- (void) setSignature: (NSString *) newSignature
{
- [[self defaultIdentity] setObject: newSignature
+ [[user defaultIdentity] setObject: newSignature
forKey: @"signature"];
- [userDefaults setObject: [user mailAccounts]
- forKey: @"MailAccounts"];
+ [user saveMailAccounts];
}
- (id <WOActionResults>) defaultAction
var account = Mailer.currentMailbox.split("/")[1];
if (accounts[account].supportsQuotas) {
var quotasUrl = ApplicationBaseURL + mailbox + "/quotas";
- triggerAjaxRequest(quotasUrl, quotasCallback);
+ if (document.quotaAjaxRequest) {
+ document.quotaAjaxRequest.aborted = true;
+ document.quotaAjaxRequest.abort();
+ }
+ document.quotaAjaxRequest = triggerAjaxRequest(quotasUrl, quotasCallback);
}
}
}
window.status = text;
}
}
+
+ document.quotaAjaxRequest = null;
}
function onMessageContextMenu(event) {
http.callbackData = null;
}
}
- catch (e) {
+ catch(e) {
activeAjaxRequests--;
checkAjaxRequestsState();
http.onreadystatechange = Prototype.emptyFunction;