2005-07-19 Helge Hess <helge.hess@opengroupware.org>
+ * SOGoMailFolder.m: report NO in -isCreateAllowed when the folder is
+ the INBOX and SOGoSpecialFoldersInRoot (altnamespace) is enabled
+ (#1472) (v0.9.112)
+
* SOGoDraftObject.m: made 'SOGoInternetMailSuffix' a pattern which can
access request values (v0.9.111)
- (NSException *)addFlagsToAllMessages:(id)_f;
+/* folder type */
+
+- (NSString *)outlookFolderClass;
+
@end
#endif /* __Mailer_SOGoMailFolder_H__ */
@implementation SOGoMailFolder
+static BOOL useAltNamespace = NO;
+
+ (int)version {
return [super version] + 0 /* v1 */;
}
+ (void)initialize {
+ NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
+
NSAssert2([super version] == 1,
@"invalid superclass (%@) version %i !",
NSStringFromClass([self superclass]), [super version]);
+
+ useAltNamespace = [ud boolForKey:@"SOGoSpecialFoldersInRoot"];
}
- (void)dealloc {
[self _loadACLPermissionFlags];
return self->somfFlags.isPostAllowed ? YES : NO;
}
-- (BOOL)isCreateAllowed {
+
+- (BOOL)isCreateAllowedInACL {
+ /* we call this directly from UIxMailAccountView */
[self _loadACLPermissionFlags];
return self->somfFlags.isCreateAllowed ? YES : NO;
}
+- (BOOL)isCreateAllowed {
+ if (useAltNamespace) {
+ /* with altnamespace, Cyrus doesn't allow mailboxes under INBOX */
+ if ([[self outlookFolderClass] isEqualToString:@"IPF.Inbox"])
+ return NO;
+ }
+ return [self isCreateAllowedInACL];
+}
+
- (BOOL)hasAdminAccess {
[self _loadACLPermissionFlags];
return self->somfFlags.hasAdminAccess ? YES : NO;
# Version file
-SUBMINOR_VERSION:=111
+SUBMINOR_VERSION:=112
# v0.9.111 requires libNGExtensions v4.5.163
# v0.9.96 requires libNGMime v4.5.223
+2005-07-19 Helge Hess <helge.hess@opengroupware.org>
+
+ * UIxMailAccountView.m: directly check the ACL of the Inbox to check
+ permissions (the Inbox will return NO on isCreateAllowed when being
+ used by altnamespace ...) (#1472) (v0.9.153)
+
2005-07-19 Marcus Mueller <znek@mulle-kybernetik.com>
* UIxMailAddressbook.m: don't restrict the Anais 'nature' flag anymore
@end
+@interface SOGoMailFolder(UsedPrivates)
+- (BOOL)isCreateAllowedInACL;
+@end
+
@implementation UIxMailAccountView
static BOOL useAltNamespace = NO;
return NO;
}
- return [self->inbox isCreateAllowed];
+ return [self->inbox isCreateAllowedInACL];
}
/* error redirects */
isSafe = NO;
cssClass = "tbicon_folderadd"; label = "Create"; },
{ link = "#"; onclick="return ctxFolderDelete(this)";
- enabled = "clientObject.isCreateAllowed";
+ enabled = "clientObject.isCreateAllowed"; // TODO: correct?
isSafe = NO;
cssClass = "tbicon_folderdel"; label = "Delete"; },
),