From 34f11a56bd7d3406667f355a211eea13900af086 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 18 May 2007 20:28:16 +0000 Subject: [PATCH 01/41] Monotone-Parent: d9866f043739db58312281104e3d2147eb8f2b42 Monotone-Revision: fab29cd0918672e08fdfbbd44425846c5bc132b8 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-18T20:28:16 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/UIxMailFolderACLEditor.m | 42 ------------------- .../MailerUI/UIxMailFolderACLEditor.wox | 13 ------ 2 files changed, 55 deletions(-) delete mode 100644 UI/MailerUI/UIxMailFolderACLEditor.m delete mode 100644 UI/Templates/MailerUI/UIxMailFolderACLEditor.wox diff --git a/UI/MailerUI/UIxMailFolderACLEditor.m b/UI/MailerUI/UIxMailFolderACLEditor.m deleted file mode 100644 index 9606edb1c..000000000 --- a/UI/MailerUI/UIxMailFolderACLEditor.m +++ /dev/null @@ -1,42 +0,0 @@ -/* - 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. -*/ - -#include - -// TODO: implement - -/* - UIxMailFolderACLEditor - - A component to edit IMAP4 ACLs on folders. It works on SOGoMailFolder - objects. -*/ - -@interface UIxMailFolderACLEditor : UIxComponent -{ -} - -@end - -#include "common.h" - -@implementation UIxMailFolderACLEditor -@end /* UIxMailFolderACLEditor */ diff --git a/UI/Templates/MailerUI/UIxMailFolderACLEditor.wox b/UI/Templates/MailerUI/UIxMailFolderACLEditor.wox deleted file mode 100644 index 421c98cad..000000000 --- a/UI/Templates/MailerUI/UIxMailFolderACLEditor.wox +++ /dev/null @@ -1,13 +0,0 @@ - - - TODO: IMAP4 ACL editor - From 55e573155885fcae739990d6e33e8149f22a7e85 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 18 May 2007 20:28:39 +0000 Subject: [PATCH 02/41] Monotone-Parent: fab29cd0918672e08fdfbbd44425846c5bc132b8 Monotone-Revision: a78d6ed51e306c9a87f169ff94e474e163a7f950 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-18T20:28:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index a9455e1fa..ac98f00bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-05-18 Wolfgang Sourdeau + * UI/MailerUI/UIxMailFolderACLEditor.m: removed obsolete module. + * UI/WebServerResources/MailerUI.js: replaced all invocations of addEventListener to the use of prototype's Event object. Also, configured all menus programmatically following descriptions lists From 8dcf0ccdda136207a6900cbb1618f26f5167e6cd Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:29:50 +0000 Subject: [PATCH 03/41] Monotone-Parent: a78d6ed51e306c9a87f169ff94e474e163a7f950 Monotone-Revision: cd6b48160bf1726c83d930229f9f628df1f1192c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:29:50 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 + UI/MailerUI/GNUmakefile | 2 +- UI/MailerUI/UIxMailUserRightsEditor.h | 58 +++++++ UI/MailerUI/UIxMailUserRightsEditor.m | 163 ++++++++++++++++++ UI/MailerUI/product.plist | 15 +- .../UIxMailUserRightsEditor.css | 49 ++++++ .../UIxMailUserRightsEditor.js | 9 + 7 files changed, 293 insertions(+), 6 deletions(-) create mode 100644 UI/MailerUI/UIxMailUserRightsEditor.h create mode 100644 UI/MailerUI/UIxMailUserRightsEditor.m create mode 100644 UI/WebServerResources/UIxMailUserRightsEditor.css create mode 100644 UI/WebServerResources/UIxMailUserRightsEditor.js diff --git a/ChangeLog b/ChangeLog index ac98f00bd..9df048988 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-18 Wolfgang Sourdeau + * UI/MailerUI/UIxMailUserRightsEditor.[hm]: new class module that + provides a view to the IMAP acls. + * UI/MailerUI/UIxMailFolderACLEditor.m: removed obsolete module. * UI/WebServerResources/MailerUI.js: replaced all invocations of diff --git a/UI/MailerUI/GNUmakefile b/UI/MailerUI/GNUmakefile index 8b3f2108d..b8e7a4b8b 100644 --- a/UI/MailerUI/GNUmakefile +++ b/UI/MailerUI/GNUmakefile @@ -39,7 +39,7 @@ MailerUI_OBJC_FILES += \ \ UIxFilterList.m \ \ - UIxMailFolderACLEditor.m + UIxMailUserRightsEditor.m # UIxSieveEditor.m MailerUI_RESOURCE_FILES += \ diff --git a/UI/MailerUI/UIxMailUserRightsEditor.h b/UI/MailerUI/UIxMailUserRightsEditor.h new file mode 100644 index 000000000..289c95c93 --- /dev/null +++ b/UI/MailerUI/UIxMailUserRightsEditor.h @@ -0,0 +1,58 @@ +/* UIxMailUserRightsEditor.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef UIXMAILUSERRIGHTSEDITOR_H +#define UIXMAILUSERRIGHTSEDITOR_H + +#import + +@interface UIxMailUserRightsEditor : UIxUserRightsEditor + +- (void) setUserCanReadMails: (BOOL) userCanReadMails; +- (BOOL) userCanReadMails; + +- (void) setUserCanWriteMails: (BOOL) userCanWriteMails; +- (BOOL) userCanWriteMails; + +- (void) setUserCanInsertMails: (BOOL) userCanInsertMails; +- (BOOL) userCanInsertMails; + +- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead; +- (BOOL) userCanMarkMailsRead; + +- (void) setUserCanEraseMails: (BOOL) userCanEraseMails; +- (BOOL) userCanEraseMails; + +- (void) setUserCanCreateSubfolders: (BOOL) userCanCreateSubfolders; +- (BOOL) userCanCreateSubfolders; + +- (void) setUserCanPostMails: (BOOL) userCanPostMails; +- (BOOL) userCanPostMails; + +- (void) setUserIsAdministrator: (BOOL) userIsAdministrator; +- (BOOL) userIsAdministrator; + +- (void) updateRights; + +@end + +#endif /* UIXMAILUSERRIGHTSEDITOR_H */ diff --git a/UI/MailerUI/UIxMailUserRightsEditor.m b/UI/MailerUI/UIxMailUserRightsEditor.m new file mode 100644 index 000000000..f2fb91ab1 --- /dev/null +++ b/UI/MailerUI/UIxMailUserRightsEditor.m @@ -0,0 +1,163 @@ +/* UIxMailUserRightsEditor.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import +#import +#import +#import + +#import "UIxMailUserRightsEditor.h" + +@implementation UIxMailUserRightsEditor + +- (void) setUserCanReadMails: (BOOL) userCanReadMails +{ + if (userCanReadMails) + [self appendRight: SOGoRole_ObjectReader]; + else + [self removeRight: SOGoRole_ObjectReader]; +} + +- (BOOL) userCanReadMails +{ + return [userRights containsObject: SOGoRole_ObjectReader]; +} + +- (void) setUserCanWriteMails: (BOOL) userCanWriteMails +{ + if (userCanWriteMails) + [self appendRight: SOGoMailRole_Writer]; + else + [self removeRight: SOGoMailRole_Writer]; +} + +- (BOOL) userCanWriteMails +{ + return [userRights containsObject: SOGoMailRole_Writer]; +} + +- (void) setUserCanInsertMails: (BOOL) userCanInsertMails +{ + if (userCanInsertMails) + [self appendRight: SOGoRole_ObjectCreator]; + else + [self removeRight: SOGoRole_ObjectCreator]; +} + +- (BOOL) userCanInsertMails +{ + return [userRights containsObject: SOGoRole_ObjectCreator]; +} + +- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead +{ + if (userCanMarkMailsRead) + [self appendRight: SOGoMailRole_SeenKeeper]; + else + [self removeRight: SOGoMailRole_SeenKeeper]; +} + +- (BOOL) userCanMarkMailsRead +{ + return [userRights containsObject: SOGoMailRole_SeenKeeper]; +} + +- (void) setUserCanEraseMails: (BOOL) userCanEraseMails +{ + if (userCanEraseMails) + [self appendRight: SOGoRole_ObjectEraser]; + else + [self removeRight: SOGoRole_ObjectEraser]; +} + +- (BOOL) userCanEraseMails +{ + return [userRights containsObject: SOGoRole_ObjectEraser]; +} + +- (void) setUserCanCreateSubfolders: (BOOL) userCanCreateSubfolders +{ + if (userCanCreateSubfolders) + [self appendRight: SOGoRole_FolderCreator]; + else + [self removeRight: SOGoRole_FolderCreator]; +} + +- (BOOL) userCanCreateSubfolders +{ + return [userRights containsObject: SOGoRole_FolderCreator]; +} + +- (void) setUserCanPostMails: (BOOL) userCanPostMails +{ + if (userCanPostMails) + [self appendRight: SOGoMailRole_Poster]; + else + [self removeRight: SOGoMailRole_Poster]; +} + +- (BOOL) userCanPostMails +{ + return [userRights containsObject: SOGoMailRole_Poster]; +} + +- (void) setUserIsAdministrator: (BOOL) userIsAdministrator +{ + if (userIsAdministrator) + [self appendRight: SOGoMailRole_Administrator]; + else + [self removeRight: SOGoMailRole_Administrator]; +} + +- (BOOL) userIsAdministrator +{ + return [userRights containsObject: SOGoMailRole_Administrator]; +} + +- (void) updateRights +{ + WORequest *request; + + request = [context request]; + + if ([[request formValueForKey: @"ObjectCreator"] length] > 0) + [self appendRight: SOGoRole_ObjectCreator]; + else + [self removeRight: SOGoRole_ObjectCreator]; + + if ([[request formValueForKey: @"ObjectEditor"] length] > 0) + [self appendRight: SOGoRole_ObjectEditor]; + else + [self removeRight: SOGoRole_ObjectEditor]; + + if ([[request formValueForKey: @"ObjectViewer"] length] > 0) + [self appendRight: SOGoRole_ObjectViewer]; + else + [self removeRight: SOGoRole_ObjectViewer]; + + if ([[request formValueForKey: @"ObjectEraser"] length] > 0) + [self appendRight: SOGoRole_ObjectEraser]; + else + [self removeRight: SOGoRole_ObjectEraser]; +} + +@end diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index 0979d877f..ea820f5b6 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -1,5 +1,5 @@ { /* -*-javascript-*- */ - requires = ( MAIN, CommonUI, Mailer ); /* , Sieve */ + requires = ( MAIN, MainUI, CommonUI, Mailer ); /* , Sieve */ publicResources = ( "uix.css", @@ -131,15 +131,20 @@ pageName = "UIxMailListView"; actionName = "deleteFolder"; }; - editACL = { - protectedBy = "View"; - pageName = "UIxMailFolderACLEditor"; - }; compose = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; actionName = "compose"; }; + userRights = { + protectedBy = "ReadAcls"; + pageName = "UIxMailUserRightsEditor"; + }; + saveUserRights = { + protectedBy = "SaveAcls"; + pageName = "UIxMailUserRightsEditor"; + actionName = "saveUserRights"; + }; }; }; diff --git a/UI/WebServerResources/UIxMailUserRightsEditor.css b/UI/WebServerResources/UIxMailUserRightsEditor.css new file mode 100644 index 000000000..eaea5734b --- /dev/null +++ b/UI/WebServerResources/UIxMailUserRightsEditor.css @@ -0,0 +1,49 @@ +DIV.title +{ color: #000; + vertical-align: bottom; + padding-top: 15px; + padding-left: 1em; + height: 33px; + background-color: #fff; + border-bottom: 1px solid #555; } + +DIV.title SPAN.value +{ margin-left: 1em; + font-size: 18px; + font-weight: bold; } + +DIV.calendarUserRights +{ margin: 1em;} + +DIV.calendarUserRights > TABLE +{ background-color: #fff; + width: 45em; + color: #999; + border-collapse: collapse; + border-bottom: 1px solid #fff; + border-right: 1px solid #fff; + border-top: 2px solid #222; + border-left: 2px solid #222; + -moz-border-top-colors: #9c9a94 #000 transparent; + -moz-border-left-colors: #9c9a94 #000 transparent; } + +DIV.calendarUserRights > TABLE TR.permissions TH +{ color: #00f; +/* background-color: #ddd; + */ border-bottom: 1px solid #999; } + +DIV.calendarUserRights > TABLE TH +{ width: 15em; } + +DIV.calendarUserRights > TABLE TD.eventType +{ width: 5em; + text-align: right; + border-right: 1px solid #999; } + +DIV.calendarUserRights > TABLE TD +{ text-align: center; + border-top: 1px solid #cecbff; } + +DIV.buttons +{ text-align: right; + margin: 1em; } diff --git a/UI/WebServerResources/UIxMailUserRightsEditor.js b/UI/WebServerResources/UIxMailUserRightsEditor.js new file mode 100644 index 000000000..71fe311f7 --- /dev/null +++ b/UI/WebServerResources/UIxMailUserRightsEditor.js @@ -0,0 +1,9 @@ +function onCancelClick(event) { + window.close(); +} + +function initACLButtons() { + $("cancelButton").addEventListener("click", onCancelClick, false); +} + +window.addEventListener("load", initACLButtons, false); From 532ef0ef2de064c6f69b322ff26d850165172b28 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:33:27 +0000 Subject: [PATCH 04/41] Monotone-Parent: cd6b48160bf1726c83d930229f9f628df1f1192c Monotone-Revision: d0d9760d8db972b55c26962043ce5344b348a982 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:33:27 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoPermissions.h | 17 ++++++++++++++--- SoObjects/SOGo/SOGoPermissions.m | 12 ++++++++++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9df048988..d6499d9c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoPermissions.[hm]: added the + SOGoRole_ObjectReader, SOGoRole_Folder*, and SOGoMailRole_* + symbols. + * UI/MailerUI/UIxMailUserRightsEditor.[hm]: new class module that provides a view to the IMAP acls. diff --git a/SoObjects/SOGo/SOGoPermissions.h b/SoObjects/SOGo/SOGoPermissions.h index 67ee64bee..aaa31af54 100644 --- a/SoObjects/SOGo/SOGoPermissions.h +++ b/SoObjects/SOGo/SOGoPermissions.h @@ -28,17 +28,25 @@ #import extern NSString *SOGoRole_ObjectCreator; +extern NSString *SOGoRole_ObjectReader; extern NSString *SOGoRole_ObjectEraser; extern NSString *SOGoRole_ObjectViewer; extern NSString *SOGoRole_ObjectEditor; +extern NSString *SOGoRole_FolderCreator; +extern NSString *SOGoRole_FolderEraser; +extern NSString *SOGoRole_FolderViewer; +extern NSString *SOGoRole_FolderReader; extern NSString *SOGoRole_AuthorizedSubscriber; extern NSString *SOGoRole_None; - extern NSString *SOGoRole_FreeBusy; extern NSString *SOGoRole_FreeBusyLookup; -extern NSString *SOGoPerm_ReadAcls; -extern NSString *SOGoPerm_FreeBusyLookup; +extern NSString *SOGoMailRole_SeenKeeper; +extern NSString *SOGoMailRole_Writer; +extern NSString *SOGoMailRole_Poster; +extern NSString *SOGoMailRole_Expunger; +extern NSString *SOGoMailRole_Creator; +extern NSString *SOGoMailRole_Administrator; extern NSString *SOGoCalendarRole_Organizer; extern NSString *SOGoCalendarRole_Participant; @@ -61,6 +69,9 @@ extern NSString *SOGoCalendarRole_ComponentDAndTViewer; extern NSString *SOGoCalendarRole_ComponentModifier; extern NSString *SOGoCalendarRole_ComponentResponder; +extern NSString *SOGoPerm_ReadAcls; +extern NSString *SOGoPerm_FreeBusyLookup; + extern NSString *SOGoCalendarPerm_ViewWholePublicRecords; extern NSString *SOGoCalendarPerm_ViewDAndTOfPublicRecords; extern NSString *SOGoCalendarPerm_ModifyPublicRecords; diff --git a/SoObjects/SOGo/SOGoPermissions.m b/SoObjects/SOGo/SOGoPermissions.m index e750ef31b..a20e68168 100644 --- a/SoObjects/SOGo/SOGoPermissions.m +++ b/SoObjects/SOGo/SOGoPermissions.m @@ -26,7 +26,12 @@ NSString *SOGoRole_ObjectCreator = @"ObjectCreator"; NSString *SOGoRole_ObjectEraser = @"ObjectEraser"; NSString *SOGoRole_ObjectViewer = @"ObjectViewer"; +NSString *SOGoRole_ObjectReader = @"ObjectReader"; NSString *SOGoRole_ObjectEditor = @"ObjectEditor"; +NSString *SOGoRole_FolderCreator = @"FolderCreate"; +NSString *SOGoRole_FolderEraser = @"FolderEraser"; +NSString *SOGoRole_FolderViewer = @"FolderViewer"; +NSString *SOGoRole_FolderReader = @"FolderReader"; NSString *SOGoRole_AuthorizedSubscriber = @"AuthorizedSubscriber"; NSString *SOGoRole_None = @"None"; @@ -60,6 +65,12 @@ NSString *SOGoCalendarRole_ComponentDAndTViewer = @"ComponentDAndTViewer"; NSString *SOGoCalendarRole_ComponentModifier = @"ComponentModifier"; NSString *SOGoCalendarRole_ComponentResponder = @"ComponentResponder"; +NSString *SOGoMailRole_SeenKeeper = @"SeenKeeper"; +NSString *SOGoMailRole_Writer = @"Writer"; +NSString *SOGoMailRole_Poster = @"Poster"; +NSString *SOGoMailRole_Expunger = @"Expunger"; +NSString *SOGoMailRole_Administrator = @"Administrator"; + /* permissions */ NSString *SOGoPerm_ReadAcls = @"ReadAcls"; /* the equivalent of "read-acl" in the WebDAV acls spec, which is @@ -83,3 +94,4 @@ NSString *SOGoCalendarPerm_ViewAllComponent = @"ViewAllComponent"; NSString *SOGoCalendarPerm_ViewDAndT = @"ViewDAndT"; NSString *SOGoCalendarPerm_ModifyComponent = @"ModifyComponent"; NSString *SOGoCalendarPerm_RespondToComponent = @"RespondToComponent"; + From 03e0e4b5d4ddeaaf2bf0d7b559939d8e29a65964 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:33:59 +0000 Subject: [PATCH 05/41] Monotone-Parent: d0d9760d8db972b55c26962043ce5344b348a982 Monotone-Revision: 2a058e00d9a205e44c2b7f7536cfbe616d115e72 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:33:59 Monotone-Branch: ca.inverse.sogo --- .../MailerUI/UIxMailUserRightsEditor.wox | 73 +++++++++++++++++++ UI/Templates/UIxAclEditor.wox | 5 +- 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 UI/Templates/MailerUI/UIxMailUserRightsEditor.wox diff --git a/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox new file mode 100644 index 000000000..aa83c752e --- /dev/null +++ b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox @@ -0,0 +1,73 @@ + + + +
+ +
+ + + + +
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+
+ + +
+
+
diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index 58ba94c90..301ef5dcb 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -22,8 +22,9 @@
- +
From df31834c3721cccc1971e57c9e2d481fbcf68b1b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:39:52 +0000 Subject: [PATCH 06/41] Monotone-Parent: 2a058e00d9a205e44c2b7f7536cfbe616d115e72 Monotone-Revision: 4db4e94b1f353dbdc30ed2247f4848acd4afdb7e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:39:52 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ SoObjects/SOGo/SOGoObject.h | 3 ++- SoObjects/SOGo/SOGoObject.m | 27 ++++++++++++++++----------- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6499d9c9..5943bf0b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -aclUsers]): renamed + "acl" to "aclUsers". Now designed to return only the uid of the + users involved in an ACL. + ([SOGoObject -hasSupportForDefaultRoles]): new method returning + "NO" by default. To indicate to the acl editor that we don't want + to handle a default user. + * SoObjects/SOGo/SOGoPermissions.[hm]: added the SOGoRole_ObjectReader, SOGoRole_Folder*, and SOGoMailRole_* symbols. diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index e5a77e739..0b2360a6a 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -101,11 +101,12 @@ extern NSString *SOGoDefaultUserID; /* acls */ - (NSArray *) defaultAclRoles; -- (NSArray *) acls; +- (NSArray *) aclUsers; - (NSArray *) aclsForUser: (NSString *) uid; - (void) setRoles: (NSArray *) roles forUser: (NSString *) uid; - (void) removeAclsForUsers: (NSArray *) users; +- (BOOL) hasSupportForDefaultRoles; /* description */ diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 57b13cd78..6fa6c5328 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -354,23 +354,23 @@ static BOOL kontactGroupDAV = YES; - (SOGoDAVSet *) davAcl { - NSArray *role; - NSEnumerator *acls; + NSArray *roles; + NSEnumerator *uids; NSMutableDictionary *aclsDictionary; - NSDictionary *currentAcl; + NSString *currentUID; SoClassSecurityInfo *sInfo; - acls = [[self acls] objectEnumerator]; aclsDictionary = [NSMutableDictionary dictionary]; + uids = [[self aclUsers] objectEnumerator]; sInfo = [[self class] soClassSecurityInfo]; - currentAcl = [acls nextObject]; - while (currentAcl) + currentUID = [uids nextObject]; + while (currentUID) { - role = [NSArray arrayWithObject: [currentAcl objectForKey: @"role"]]; - [aclsDictionary setObject: [sInfo DAVPermissionsForRoles: role] - forKey: [currentAcl objectForKey: @"uid"]]; - currentAcl = [acls nextObject]; + roles = [self aclsForUser: currentUID]; + [aclsDictionary setObject: [sInfo DAVPermissionsForRoles: roles] + forKey: currentUID]; + currentUID = [uids nextObject]; } [self _appendRolesForPseudoPrincipals: aclsDictionary withClassSecurityInfo: sInfo]; @@ -707,7 +707,7 @@ static BOOL kontactGroupDAV = YES; /* acls */ -- (NSArray *) acls +- (NSArray *) aclUsers { [self subclassResponsibility: _cmd]; @@ -739,6 +739,11 @@ static BOOL kontactGroupDAV = YES; [self subclassResponsibility: _cmd]; } +- (BOOL) hasSupportForDefaultRoles +{ + return NO; +} + /* description */ - (void)appendAttributesToDescription:(NSMutableString *)_ms { From 8a8dd9eca7baf99e154bcce3bd3e7adeecfb06e5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:41:01 +0000 Subject: [PATCH 07/41] Monotone-Parent: 4db4e94b1f353dbdc30ed2247f4848acd4afdb7e Monotone-Revision: 08eb86c1f84dbf4d09421e5a6380398cb40d40e0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:41:01 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/NSArray+Utilities.h | 6 ++++++ SoObjects/SOGo/NSArray+Utilities.m | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5943bf0b0..00cca87c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/NSArray+Utilities.m ([NSMutableArray + -addObjectUniquely:object]): new method with an explicit name. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -aclUsers]): renamed "acl" to "aclUsers". Now designed to return only the uid of the users involved in an ACL. diff --git a/SoObjects/SOGo/NSArray+Utilities.h b/SoObjects/SOGo/NSArray+Utilities.h index 15cbb174b..2617538d3 100644 --- a/SoObjects/SOGo/NSArray+Utilities.h +++ b/SoObjects/SOGo/NSArray+Utilities.h @@ -39,4 +39,10 @@ @end +@interface NSMutableArray (SOGoArrayUtilities) + +- (void) addObjectUniquely: (id) object; + +@end + #endif /* NSARRAY_UTILITIES_H */ diff --git a/SoObjects/SOGo/NSArray+Utilities.m b/SoObjects/SOGo/NSArray+Utilities.m index ed30b5e5a..75dec348c 100644 --- a/SoObjects/SOGo/NSArray+Utilities.m +++ b/SoObjects/SOGo/NSArray+Utilities.m @@ -59,3 +59,14 @@ } @end + +@implementation NSMutableArray (SOGoArrayUtilities) + +- (void) addObjectUniquely: (id) object +{ + if (![self containsObject: object]) + [self addObject: object]; +} + +@end + From 67885686a7b37289d6f7c120324ef3fc5609916e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:41:41 +0000 Subject: [PATCH 08/41] Monotone-Parent: 08eb86c1f84dbf4d09421e5a6380398cb40d40e0 Monotone-Revision: 40c106f6426b8e1f4943286f3f606ecd1f013ced Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:41:41 Monotone-Branch: ca.inverse.sogo --- SoObjects/Mailer/SOGoMailObject.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 749882e16..14af16563 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -640,7 +640,9 @@ static BOOL debugSoParts = NO; /* permissions */ - (BOOL)isDeletionAllowed { - return [[self container] isDeleteAndExpungeAllowed]; +#warning b0000ooo + return YES; +// return [[self container] isDeleteAndExpungeAllowed]; } /* name lookup */ From fcae7eb6eee2e2192c1cd5e46245f6f013b5c39b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:42:51 +0000 Subject: [PATCH 09/41] Monotone-Parent: 40c106f6426b8e1f4943286f3f606ecd1f013ced Monotone-Revision: 65e073a1a7c3638a4e473b21d5bb1d6818959ed1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:42:51 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/SOGoContentObject.m | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00cca87c2..3d065b85c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject + -hasSupportForDefaultRoles]): override method by returning "YES". + * SoObjects/SOGo/NSArray+Utilities.m ([NSMutableArray -addObjectUniquely:object]): new method with an explicit name. diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index ed75b3ce3..451afdd76 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -218,9 +218,9 @@ : 0 /* 0 means 'do not check' */; /* attempt a save */ - - if ((error = [self saveContentString:[rq contentAsString] - baseVersion:baseVersion]) != nil) + + if ((error = [self saveContentString: [rq contentAsString] + baseVersion: baseVersion]) != nil) return error; /* setup response */ @@ -303,9 +303,9 @@ /* acls */ -- (NSArray *) acls +- (NSArray *) aclUsers { - return [container aclsForObjectAtPath: [self pathArrayToSoObject]]; + return [container aclUsersForObjectAtPath: [self pathArrayToSoObject]]; } - (NSArray *) aclsForUser: (NSString *) uid @@ -343,6 +343,11 @@ forObjectAtPath: [self pathArrayToSoObject]]; } +- (BOOL) hasSupportForDefaultRoles +{ + return YES; +} + /* message type */ - (NSString *) outlookMessageClass From 9d59126807136ccec3a91e4f724d9f2a8fc8a273 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:43:40 +0000 Subject: [PATCH 10/41] Monotone-Parent: 65e073a1a7c3638a4e473b21d5bb1d6818959ed1 Monotone-Revision: 62b78b812fed483061667782c81d44c853e623f9 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:43:40 Monotone-Branch: ca.inverse.sogo --- UI/Common/UIxAclEditor.h | 2 +- UI/Common/UIxAclEditor.m | 25 +++++++++++-------------- UI/WebServerResources/UIxAclEditor.js | 4 +++- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/UI/Common/UIxAclEditor.h b/UI/Common/UIxAclEditor.h index e4d0b1d35..72a34dbaf 100644 --- a/UI/Common/UIxAclEditor.h +++ b/UI/Common/UIxAclEditor.h @@ -29,7 +29,7 @@ { BOOL prepared; BOOL publishInFreeBusy; - NSArray *acls; + NSArray *aclUsers; NSArray *savedUIDs; NSMutableArray *users; NSString *currentUser; diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index e0328ace9..e87a15259 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -29,6 +29,7 @@ #import #import #import +#import #import "UIxAclEditor.h" @@ -38,7 +39,7 @@ { if ((self = [super init])) { - acls = nil; + aclUsers = nil; prepared = NO; publishInFreeBusy = NO; users = [NSMutableArray new]; @@ -59,10 +60,10 @@ - (NSArray *) aclsForObject { - if (!acls) - acls = [[self clientObject] acls]; + if (!aclUsers) + aclUsers = [[self clientObject] aclUsers]; - return acls; + return aclUsers; } - (NSString *) _displayNameForUID: (NSString *) uid @@ -92,24 +93,20 @@ - (void) _prepareUsers { NSEnumerator *aclsEnum; - NSDictionary *currentAcl; NSString *currentUID, *ownerLogin; ownerLogin = [[self clientObject] ownerInContext: context]; aclsEnum = [[self aclsForObject] objectEnumerator]; - currentAcl = [aclsEnum nextObject]; - while (currentAcl) + currentUID = [aclsEnum nextObject]; + while (currentUID) { - currentUID = [currentAcl objectForKey: @"c_uid"]; if (!([currentUID isEqualToString: ownerLogin] - || [currentUID isEqualToString: SOGoDefaultUserID] - || [users containsObject: currentUID])) - [users addObject: currentUID]; - currentAcl = [aclsEnum nextObject]; - - prepared = YES; + || [currentUID isEqualToString: SOGoDefaultUserID])) + [users addObjectUniquely: currentUID]; + currentUID = [aclsEnum nextObject]; } + prepared = YES; } - (NSArray *) usersForObject diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index 74845b325..0745c2fe0 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -119,7 +119,9 @@ function onOpenUserRights(event) { function onAclLoadHandler() { defaultUserID = $("defaultUserID").value; - Event.observe($("defaultRolesBtn"), "click", openRightsForDefaultUser); + var defaultRolesBtn = $("defaultRolesBtn"); + if (defaultRolesBtn) + Event.observe(defaultRolesBtn, "click", openRightsForDefaultUser); var ul = $("userList"); var lis = ul.childNodesWithTag("li"); for (var i = 0; i < lis.length; i++) From 781eae4ba5dd4790a4276721029b359805cd1342 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:46:16 +0000 Subject: [PATCH 11/41] Monotone-Parent: 62b78b812fed483061667782c81d44c853e623f9 Monotone-Revision: 617fa1501ed731ebbd3ccbe493d88a1bc0a7fd02 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:46:16 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 + SoObjects/Mailer/SOGoMailFolder.h | 21 ---- SoObjects/Mailer/SOGoMailFolder.m | 182 +++++++++++++++--------------- 3 files changed, 99 insertions(+), 109 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d065b85c..8c2acf9dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailFolder.m: removed all the previous + methods that would have been used to support IMAP acls. Replaced + them with the new protocol for them that has been implemented in + SOGo during the last few weeks. + * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject -hasSupportForDefaultRoles]): override method by returning "YES". diff --git a/SoObjects/Mailer/SOGoMailFolder.h b/SoObjects/Mailer/SOGoMailFolder.h index ce49d2a4c..a698bdaaa 100644 --- a/SoObjects/Mailer/SOGoMailFolder.h +++ b/SoObjects/Mailer/SOGoMailFolder.h @@ -41,17 +41,6 @@ NSArray *filenames; NSString *folderType; NGImap4MailboxInfo *selectInfo; - struct { - int didCheckMyRights:1; - int isDeleteAndExpungeAllowed:1; - int isReadAllowed:1; - int isWriteAllowed:1; - int isInsertAllowed:1; - int isPostAllowed:1; - int isCreateAllowed:1; - int hasAdminAccess:1; - int reserved:24; - } somfFlags; } /* messages */ @@ -63,16 +52,6 @@ - (NSException *)expunge; -/* permissions */ - -- (BOOL)isDeleteAndExpungeAllowed; -- (BOOL)isReadAllowed; -- (BOOL)isWriteAllowed; -- (BOOL)isInsertAllowed; -- (BOOL)isPostAllowed; -- (BOOL)isCreateAllowed; -- (BOOL)hasAdminAccess; - /* flags */ - (NSException *)addFlagsToAllMessages:(id)_f; diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index cf537404a..ec4870e2d 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -19,13 +19,25 @@ 02111-1307, USA. */ -#include "SOGoMailFolder.h" -#include "SOGoMailObject.h" -#include "SOGoMailAccount.h" -#include "SOGoMailManager.h" -#include -#include "SOGoMailFolderDataSource.h" -#include "common.h" +#import + +#import +#import +#import +#import + +#import +#import +#import + +#import +#import + +#import "SOGoMailObject.h" +#import "SOGoMailAccount.h" +#import "SOGoMailManager.h" +#import "SOGoMailFolderDataSource.h" +#import "SOGoMailFolder.h" @implementation SOGoMailFolder @@ -121,87 +133,6 @@ static BOOL useAltNamespace = NO; return nil; /* no error */ } -/* permissions */ - -- (void)_loadACLPermissionFlags { - NSString *rights; - unsigned i, len; - - if (self->somfFlags.didCheckMyRights) - return; - - rights = [[self imap4Connection] myRightsForMailboxAtURL:[self imap4URL]]; - if ([rights isKindOfClass:[NSException class]]) { - [self logWithFormat:@"ERROR: could not retrieve ACL: %@", rights]; - return; - } - - // [self logWithFormat:@"GOT PERM: %@", rights]; - - self->somfFlags.didCheckMyRights = 1; - - /* reset flags */ - self->somfFlags.isDeleteAndExpungeAllowed = 0; - self->somfFlags.isReadAllowed = 0; - self->somfFlags.isWriteAllowed = 0; - self->somfFlags.isInsertAllowed = 0; - self->somfFlags.isPostAllowed = 0; - self->somfFlags.isCreateAllowed = 0; - self->somfFlags.hasAdminAccess = 0; - - for (i = 0, len = [rights length]; i < len; i++) { - switch ([rights characterAtIndex:i]) { - case 'd': self->somfFlags.isDeleteAndExpungeAllowed = 1; break; - case 'r': self->somfFlags.isReadAllowed = 1; break; - case 'w': self->somfFlags.isWriteAllowed = 1; break; - case 'i': self->somfFlags.isInsertAllowed = 1; break; - case 'p': self->somfFlags.isPostAllowed = 1; break; - case 'c': self->somfFlags.isCreateAllowed = 1; break; - case 'a': self->somfFlags.hasAdminAccess = 1; break; - } - } -} - -- (BOOL)isDeleteAndExpungeAllowed { - [self _loadACLPermissionFlags]; - return self->somfFlags.isDeleteAndExpungeAllowed ? YES : NO; -} -- (BOOL)isReadAllowed { - [self _loadACLPermissionFlags]; - return self->somfFlags.isReadAllowed ? YES : NO; -} -- (BOOL)isWriteAllowed { - [self _loadACLPermissionFlags]; - return self->somfFlags.isWriteAllowed ? YES : NO; -} -- (BOOL)isInsertAllowed { - [self _loadACLPermissionFlags]; - return self->somfFlags.isInsertAllowed ? YES : NO; -} -- (BOOL)isPostAllowed { - [self _loadACLPermissionFlags]; - return self->somfFlags.isPostAllowed ? YES : NO; -} - -- (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; -} - /* messages */ - (NSArray *)fetchUIDsMatchingQualifier:(id)_q sortOrdering:(id)_so { @@ -387,4 +318,79 @@ static BOOL useAltNamespace = NO; return self->folderType; } +/* acls */ + +- (NSArray *) _imapAclsToSOGoAcls: (NSString *) imapAcls +{ + unsigned int count, max; + NSMutableArray *SOGoAcls; + + SOGoAcls = [NSMutableArray array]; + max = [imapAcls length]; + for (count = 0; count < max; count++) + { + switch ([imapAcls characterAtIndex: count]) + { + case 'l': + [SOGoAcls addObjectUniquely: SOGoRole_FolderViewer]; + break; + case 'r': + [SOGoAcls addObjectUniquely: SOGoRole_ObjectReader]; + break; + case 's': + [SOGoAcls addObjectUniquely: SOGoMailRole_SeenKeeper]; + break; + case 'w': + [SOGoAcls addObjectUniquely: SOGoMailRole_Writer]; + break; + case 'i': + [SOGoAcls addObjectUniquely: SOGoRole_ObjectCreator]; + break; + case 'p': + [SOGoAcls addObjectUniquely: SOGoMailRole_Poster]; + break; + case 'k': + [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; + break; + case 'x': + [SOGoAcls addObjectUniquely: SOGoRole_FolderEraser]; + [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; + break; + case 't': + [SOGoAcls addObjectUniquely: SOGoRole_ObjectEraser]; + break; + case 'e': + [SOGoAcls addObjectUniquely: SOGoMailRole_Expunger]; + break; + case 'c': + [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; + break; + case 'd': + [SOGoAcls addObjectUniquely: SOGoRole_ObjectEraser]; + [SOGoAcls addObjectUniquely: SOGoMailRole_Expunger]; + break; + case 'a': + [SOGoAcls addObjectUniquely: SOGoMailRole_Administrator]; + break; + } + } + + return SOGoAcls; +} + +- (NSArray *) aclUsers +{ + NSDictionary *imapAcls; + + imapAcls = [imap4 aclForMailboxAtURL: [self imap4URL]]; + + return [imapAcls allKeys]; +} + +- (NSArray *) defaultAclRoles +{ + return [NSArray arrayWithObjects: SOGoRole_FolderViewer, + SOGoRole_FolderReader, SOGoMailRole_SeenKeeper, nil]; +} + @end /* SOGoMailFolder */ From 63e7fcaf087ce3800455d5d40e0ed64af8616eb5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 00:49:05 +0000 Subject: [PATCH 12/41] Monotone-Parent: 617fa1501ed731ebbd3ccbe493d88a1bc0a7fd02 Monotone-Revision: 7a59198f4742259b4e227285ce7009dcd7fff7e0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T00:49:05 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ SoObjects/SOGo/SOGoFolder.h | 2 +- SoObjects/SOGo/SOGoFolder.m | 15 +++++++++++---- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8c2acf9dd..e82be45c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2007-05-18 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder + -aclUsersForObjectAtPath:objectPathArray]): new method that being + forwarded the calles to aclUsers for the GCS-based subclasses of + SOGoObject. + * SoObjects/Mailer/SOGoMailFolder.m: removed all the previous methods that would have been used to support IMAP acls. Replaced them with the new protocol for them that has been implemented in diff --git a/SoObjects/SOGo/SOGoFolder.h b/SoObjects/SOGo/SOGoFolder.h index b5527d498..a6aaf18d6 100644 --- a/SoObjects/SOGo/SOGoFolder.h +++ b/SoObjects/SOGo/SOGoFolder.h @@ -72,7 +72,7 @@ - (NSException *) delete; /* acls as a container */ -- (NSArray *) aclsForObjectAtPath: (NSArray *) objectPathArray; +- (NSArray *) aclUsersForObjectAtPath: (NSArray *) objectPathArray; - (NSArray *) aclsForUser: (NSString *) uid forObjectAtPath: (NSArray *) objectPathArray; - (void) setRoles: (NSArray *) roles diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index a55c3dad2..2fe7f49e7 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -266,16 +266,18 @@ /* acls as a container */ -- (NSArray *) aclsForObjectAtPath: (NSArray *) objectPathArray; +- (NSArray *) aclUsersForObjectAtPath: (NSArray *) objectPathArray; { EOQualifier *qualifier; NSString *qs; + NSArray *records; qs = [NSString stringWithFormat: @"c_object = '/%@'", [objectPathArray componentsJoinedByString: @"/"]]; qualifier = [EOQualifier qualifierWithQualifierFormat: qs]; + records = [[self ocsFolder] fetchAclMatchingQualifier: qualifier]; - return [[self ocsFolder] fetchAclMatchingQualifier: qualifier]; + return [records valueForKey: @"c_uid"]; } - (NSArray *) _fetchAclsForUser: (NSString *) uid @@ -424,9 +426,9 @@ return nil; } -- (NSArray *) acls +- (NSArray *) aclUsers { - return [self aclsForObjectAtPath: [self pathArrayToSoObject]]; + return [self aclUsersForObjectAtPath: [self pathArrayToSoObject]]; } - (NSArray *) aclsForUser: (NSString *) uid @@ -449,6 +451,11 @@ forObjectAtPath: [self pathArrayToSoObject]]; } +- (BOOL) hasSupportForDefaultRoles +{ + return YES; +} + /* WebDAV */ - (BOOL) davIsCollection From dfb883329617f9fd75fd07dbdc4ac1d1585dce6b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 01:12:23 +0000 Subject: [PATCH 13/41] Monotone-Parent: 7a59198f4742259b4e227285ce7009dcd7fff7e0 Monotone-Revision: 0482c2d4ea255701efd25d0b3feea5ebf5eae997 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T01:12:23 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/ContactsUI.js | 20 ++++++++++---------- UI/WebServerResources/MailerUI.js | 20 ++++++++++++++++---- UI/WebServerResources/SchedulerUI.js | 18 +++++++++--------- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 5e4c664ec..0e190b0f4 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -611,21 +611,21 @@ function configureContactFolders() { } } -function onAccessRightsMenuEntryMouseUp(event) { - var folders = $("contactFolders"); - var selected = folders.getSelectedNodes()[0]; - var title = this.innerHTML; - var url = URLForFolderID(selected.getAttribute("id")) +function onMenuSharing(event) { + var folders = $("contactFolders"); + var selected = folders.getSelectedNodes()[0]; + var title = this.innerHTML; + var url = URLForFolderID(selected.getAttribute("id")); - openAclWindow(url + "/acls", title); + openAclWindow(url + "/acls", title); } function initializeMenus() { - var menus = new Array("contactFoldersMenu", "contactMenu", "searchMenu"); - initMenusNamed(menus); +// var menus = new Array("contactFoldersMenu", "contactMenu", "searchMenu"); +// initMenusNamed(menus); - var menuEntry = $("accessRightsMenuEntry"); - menuEntry.addEventListener("mouseup", onAccessRightsMenuEntryMouseUp, false); +// var menuEntry = $("accessRightsMenuEntry"); +// menuEntry.addEventListener("mouseup", onMenuSharing, false); } function configureSearchField() { diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index d64e78e1f..613963397 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -4,6 +4,10 @@ var currentMessages = new Array(); var maxCachedMessages = 20; var cachedMessages = new Array(); var currentMailbox = ''; + +var usersRightsWindowHeight = 250; +var usersRightsWindowWidth = 502; + /* mail list */ function openMessageWindow(msguid, url) { @@ -113,6 +117,14 @@ function openAddressbook(sender) { return false; } +function onMenuSharing(event) { + var folderID = document.menuTarget.getAttribute("dataname"); + var urlstr = URLForFolderID(folderID) + "/acls"; + event.preventDefault(); + + openAclWindow(urlstr); +} + /* mail list DOM changes */ function markMailInWindow(win, msguid, markread) { @@ -1059,13 +1071,13 @@ function initializeMenus() { "messageContentMenu", "label-menu", "mark-menu"); menus["accountIconMenu"] = new Array(null, null, null, null, null, null, - null, null, null, null); + null, null, null, onMenuSharing); menus["inboxIconMenu"] = new Array(null, null, null, "-", null, null, - null, "-", null, null); + null, "-", null, onMenuSharing); menus["trashIconMenu"] = new Array(null, null, null, "-", null, null, null, - null, "-", null, null); + null, "-", null, onMenuSharing); menus["mailboxIconMenu"] = new Array(null, null, null, "-", null, null, - null, null, null, "-", null, null); + null, null, null, "-", null, onMenuSharing); menus["addressMenu"] = new Array(newContactFromEmail, newEmailTo, null); menus["messageListMenu"] = new Array(onMenuOpenMessage, "-", onMenuReplyToSender, diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 718df0f35..297ae334c 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -980,19 +980,19 @@ function browseURL(anchor, event) { } function initializeMenus() { - var menus = new Array("monthListMenu", "yearListMenu", - "appointmentsListMenu", "calendarsMenu", "searchMenu"); - initMenusNamed(menus); +// var menus = new Array("monthListMenu", "yearListMenu", +// "appointmentsListMenu", "calendarsMenu", "searchMenu"); +// initMenusNamed(menus); - $("calendarSelector").attachMenu("calendarsMenu"); +// $("calendarSelector").attachMenu("calendarsMenu"); - var accessRightsMenuEntry = $("accessRightsMenuEntry"); - accessRightsMenuEntry.addEventListener("mouseup", - onAccessRightsMenuEntryMouseUp, - false); +// var accessRightsMenuEntry = $("accessRightsMenuEntry"); +// accessRightsMenuEntry.addEventListener("mouseup", +// onMenuSharing, +// false); } -function onAccessRightsMenuEntryMouseUp(event) { +function onMenuSharing(event) { var folders = $("calendarList"); var selected = folders.getSelectedNodes()[0]; var folderID = selected.getAttribute("id"); From 59fd9030604cf8c1aab5b40fb8e8b34b3f903deb Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Sat, 19 May 2007 01:12:28 +0000 Subject: [PATCH 14/41] Monotone-Parent: 0482c2d4ea255701efd25d0b3feea5ebf5eae997 Monotone-Revision: a0715acf1cc86b5389ffa60d65b3f90e4d976e79 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-19T01:12:28 Monotone-Branch: ca.inverse.sogo --- UI/Contacts/English.lproj/Localizable.strings | 2 +- UI/Contacts/French.lproj/Localizable.strings | 2 +- UI/MailerUI/French.lproj/Localizable.strings | 2 +- UI/Scheduler/English.lproj/Localizable.strings | 2 +- UI/Scheduler/French.lproj/Localizable.strings | 2 +- UI/Templates/ContactsUI/UIxContactsListViewContainer.wox | 2 +- UI/Templates/MailerUI/UIxMailMainFrame.wox | 6 +++--- UI/Templates/SchedulerUI/UIxCalMainView.wox | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/UI/Contacts/English.lproj/Localizable.strings b/UI/Contacts/English.lproj/Localizable.strings index cca322a0b..16704ace6 100644 --- a/UI/Contacts/English.lproj/Localizable.strings +++ b/UI/Contacts/English.lproj/Localizable.strings @@ -43,7 +43,7 @@ "New Card" = "New Card"; "New List" = "New List"; "Modify" = "Modify"; -"Access Rights..." = "Access Rights..."; +"Sharing..." = "Sharing..."; "Write" = "Write"; "Delete" = "Delete"; "Instant Message" = "Instant Message"; diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index aaf6e2075..0d73332ed 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -50,7 +50,7 @@ "New Card" = "Nouvelle fiche"; "New List" = "Nouvelle liste"; "Modify" = "Modifier"; -"Access Rights..." = "Partage..."; +"Sharing..." = "Partage..."; "Write" = "Écrire"; "Delete" = "Effacer"; "Instant Message" = "Message instantané"; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 6ba4a8d3e..427011508 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -106,7 +106,7 @@ "New Folder..." = "Nouveau dossier..."; "Compact This Folder" = "Compacter ce dossier"; "Search Messages..." = "Rechercher dans les messages..."; -"Properties..." = "Propriétés"; +"Sharing..." = "Partage..."; "New Subfolder..." = "Nouveau sous-dossier..."; "Rename Folder..." = "Renommer le dossier..."; "Delete Folder" = "Supprimer le dossier..."; diff --git a/UI/Scheduler/English.lproj/Localizable.strings b/UI/Scheduler/English.lproj/Localizable.strings index 050f12def..05d991c9a 100644 --- a/UI/Scheduler/English.lproj/Localizable.strings +++ b/UI/Scheduler/English.lproj/Localizable.strings @@ -70,7 +70,7 @@ "New Calendar..." = "New Calendar..."; "Delete Calendar" = "Delete Calendar"; -"Access Rights..." = "Access Rights..."; +"Sharing..." = "Sharing..."; "Export Calendar..." = "Export Calendar..."; "Publish Calendar..." = "Publish Calendar..."; "Reload Remote Calendars" = "Reload Remote Calendars"; diff --git a/UI/Scheduler/French.lproj/Localizable.strings b/UI/Scheduler/French.lproj/Localizable.strings index 46b02d33a..44e9be99e 100644 --- a/UI/Scheduler/French.lproj/Localizable.strings +++ b/UI/Scheduler/French.lproj/Localizable.strings @@ -71,7 +71,7 @@ "New Calendar..." = "Nouvel agenda..."; "Delete Calendar" = "Effacer l'agenda"; -"Access Rights..." = "Partage"; +"Sharing..." = "Partage..."; "Export Calendar..." = "Exporter l'agenda..."; "Publish Calendar..." = "Publier l'agenda..."; "Reload Remote Calendars" = "Recharger les agendas distants"; diff --git a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox index f53445b0d..3c482934a 100644 --- a/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox +++ b/UI/Templates/ContactsUI/UIxContactsListViewContainer.wox @@ -14,7 +14,7 @@ @@ -46,7 +46,7 @@
  • -
  • +
  • @@ -63,7 +63,7 @@
  • -
  • +
  • diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index 62d0d9c25..e065bda08 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -53,7 +53,7 @@
    • -
    • +
    • From 1547feccf321c2cba7e4d56429189f9ff1c78f0d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 14:38:54 +0000 Subject: [PATCH 15/41] Monotone-Parent: a0715acf1cc86b5389ffa60d65b3f90e4d976e79 Monotone-Revision: 37ceea55166e4e5489fd66be14e66b1dc1635432 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T14:38:54 Monotone-Branch: ca.inverse.sogo --- .../SchedulerUI/UIxCalFilterPanel.wox | 4 +- UI/Templates/SchedulerUI/UIxCalMainView.wox | 50 ++++----- UI/WebServerResources/HTMLElement.js | 2 +- UI/WebServerResources/MailerUI.js | 3 +- UI/WebServerResources/SchedulerUI.js | 106 +++++++++++------- UI/WebServerResources/UIxAclEditor.js | 9 +- 6 files changed, 98 insertions(+), 76 deletions(-) diff --git a/UI/Templates/SchedulerUI/UIxCalFilterPanel.wox b/UI/Templates/SchedulerUI/UIxCalFilterPanel.wox index 44c03cade..c0b6f513b 100644 --- a/UI/Templates/SchedulerUI/UIxCalFilterPanel.wox +++ b/UI/Templates/SchedulerUI/UIxCalFilterPanel.wox @@ -7,9 +7,7 @@ > diff --git a/UI/Templates/SchedulerUI/UIxCalMainView.wox b/UI/Templates/SchedulerUI/UIxCalMainView.wox index e065bda08..688969bd3 100644 --- a/UI/Templates/SchedulerUI/UIxCalMainView.wox +++ b/UI/Templates/SchedulerUI/UIxCalMainView.wox @@ -14,10 +14,7 @@ diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index 1d17513b4..334291133 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -615,8 +615,9 @@ function onMenuSharing(event) { function initializeMenus() { menus["menuIds"] = new Array("contactFoldersMenu", "contactMenu", "searchMenu"); - menus["contactFoldersMenu"] = new Array(null, onMenuSharing, "-", null, - null, "-", null); + menus["contactFoldersMenu"] = new Array(null, "-", null, + null, "-", null, "-", + onMenuSharing); menus["contactMenu"] = new Array(onMenuEditContact, "-", onMenuWriteToContact, null, "-", onMenuDeleteContact); diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 4628e08f0..b8ed20fe4 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -1005,7 +1005,7 @@ function initializeMenus() { editEvent, deleteEvent, "-", onSelectAll, "-", null, null); - menus["calendarsMenu"] = new Array(null, null, null, "-", null, null, "-", + menus["calendarsMenu"] = new Array(null, null, "-", null, null, "-", null, "-", onMenuSharing); menus["searchMenu"] = new Array(setSearchCriteria); diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 90c61c400..d9cf205b8 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -1076,11 +1076,11 @@ function indexColor(number) { var onLoadHandler = function (event) { queryParameters = parseQueryParameters('' + window.location); - if (!$(document.body).hasClassName("popup")) { + if (!document.body.hasClassName("popup")) { initLogConsole(); - initializeMenus(); initCriteria(); } + initializeMenus(); initTabs(); configureDragHandles(); configureSortableTableHeaders(); From 2b61bad48b8cd6de31d31c32a209cec1df1c7ce4 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 15:24:08 +0000 Subject: [PATCH 18/41] Monotone-Parent: 1cb455e5ec2a7e5fe584f0aabe21cd236f2e01d8 Monotone-Revision: f1be023e9aabffedd5489218c3c7c909a4238dde Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T15:24:08 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/SchedulerUI.js | 5 +++-- UI/WebServerResources/generic.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index b8ed20fe4..4c902a369 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -1010,8 +1010,9 @@ function initializeMenus() { menus["searchMenu"] = new Array(setSearchCriteria); initMenus(); - - $("calendarSelector").attachMenu("calendarsMenu"); + var selector = $("calendarSelector"); + if (selector) + selector.attachMenu("calendarsMenu"); } function onMenuSharing(event) { diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index d9cf205b8..7943f2f2a 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -909,7 +909,8 @@ function initMenus() { var menuId = menus["menuIds"][i]; var callbacks = menus[menuId]; var menuDIV = $(menuId); - initMenu(menuDIV, callbacks); + if (menuDIV) + initMenu(menuDIV, callbacks); } } From d816587401608342a6f7a61475add349c145a738 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:33:45 +0000 Subject: [PATCH 19/41] Monotone-Parent: f1be023e9aabffedd5489218c3c7c909a4238dde Monotone-Revision: d581866eeb3e11ed3f8c8583be73f14f00325d7e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:33:45 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 9 +++ SoObjects/Mailer/SOGoMailFolder.m | 112 ++++++++++++++++++++++++++---- 2 files changed, 108 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index e82be45c3..12b4c3aa1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-05-22 Wolfgang Sourdeau + + * SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder + -aclsForUser:uid]): overriden method. + ([SOGoMailFolder -removeAclsForUsers:users]): overriden method. + ([SOGoMailFolder -setRoles:rolesforUser:uid]): overriden method. + ([SOGoMailFolder -defaultUserID]): overriden method. + ([SOGoMailFolder -hasSupportForDefaultRoles]): overriden method. + 2007-05-18 Wolfgang Sourdeau * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index ec4870e2d..b44cbf448 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -332,7 +332,7 @@ static BOOL useAltNamespace = NO; switch ([imapAcls characterAtIndex: count]) { case 'l': - [SOGoAcls addObjectUniquely: SOGoRole_FolderViewer]; + [SOGoAcls addObjectUniquely: SOGoRole_ObjectViewer]; break; case 'r': [SOGoAcls addObjectUniquely: SOGoRole_ObjectReader]; @@ -353,22 +353,14 @@ static BOOL useAltNamespace = NO; [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; break; case 'x': - [SOGoAcls addObjectUniquely: SOGoRole_FolderEraser]; - [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; + [SOGoAcls addObjectUniquely: SOGoRole_ObjectEraser]; break; case 't': - [SOGoAcls addObjectUniquely: SOGoRole_ObjectEraser]; + [SOGoAcls addObjectUniquely: SOGoMailRole_MessageEraser]; break; case 'e': [SOGoAcls addObjectUniquely: SOGoMailRole_Expunger]; break; - case 'c': - [SOGoAcls addObjectUniquely: SOGoRole_FolderCreator]; - break; - case 'd': - [SOGoAcls addObjectUniquely: SOGoRole_ObjectEraser]; - [SOGoAcls addObjectUniquely: SOGoMailRole_Expunger]; - break; case 'a': [SOGoAcls addObjectUniquely: SOGoMailRole_Administrator]; break; @@ -378,6 +370,52 @@ static BOOL useAltNamespace = NO; return SOGoAcls; } +- (NSString *) _sogoAclsToImapAcls: (NSArray *) sogoAcls +{ + NSMutableString *imapAcls; + NSEnumerator *acls; + NSString *currentAcl; + char character; + + imapAcls = [NSMutableString string]; + acls = [sogoAcls objectEnumerator]; + currentAcl = [acls nextObject]; + while (currentAcl) + { + if ([currentAcl isEqualToString: SOGoRole_ObjectViewer]) + character = 'l'; + else if ([currentAcl isEqualToString: SOGoRole_ObjectReader]) + character = 'r'; + else if ([currentAcl isEqualToString: SOGoMailRole_SeenKeeper]) + character = 's'; + else if ([currentAcl isEqualToString: SOGoMailRole_Writer]) + character = 'w'; + else if ([currentAcl isEqualToString: SOGoRole_ObjectCreator]) + character = 'i'; + else if ([currentAcl isEqualToString: SOGoMailRole_Poster]) + character = 'p'; + else if ([currentAcl isEqualToString: SOGoRole_FolderCreator]) + character = 'k'; + else if ([currentAcl isEqualToString: SOGoRole_ObjectEraser]) + character = 'x'; + else if ([currentAcl isEqualToString: SOGoMailRole_MessageEraser]) + character = 't'; + else if ([currentAcl isEqualToString: SOGoMailRole_Expunger]) + character = 'e'; + else if ([currentAcl isEqualToString: SOGoMailRole_Administrator]) + character = 'a'; + else + character = 0; + + if (character) + [imapAcls appendFormat: @"%c", character]; + + currentAcl = [acls nextObject]; + } + + return imapAcls; +} + - (NSArray *) aclUsers { NSDictionary *imapAcls; @@ -387,10 +425,58 @@ static BOOL useAltNamespace = NO; return [imapAcls allKeys]; } +- (NSArray *) aclsForUser: (NSString *) uid +{ + NSDictionary *imapAcls; + + imapAcls = [imap4 aclForMailboxAtURL: [self imap4URL]]; + + return [self _imapAclsToSOGoAcls: [imapAcls objectForKey: uid]]; +} + - (NSArray *) defaultAclRoles { - return [NSArray arrayWithObjects: SOGoRole_FolderViewer, - SOGoRole_FolderReader, SOGoMailRole_SeenKeeper, nil]; + return [NSArray arrayWithObjects: SOGoRole_ObjectViewer, + SOGoRole_ObjectReader, SOGoMailRole_SeenKeeper, nil]; +} + +- (void) removeAclsForUsers: (NSArray *) users +{ + NSEnumerator *uids; + NSString *currentUID; + NSString *folderName; + NGImap4Client *client; + + folderName = [imap4 imap4FolderNameForURL: [self imap4URL]]; + client = [imap4 client]; + + uids = [users objectEnumerator]; + currentUID = [uids nextObject]; + while (currentUID) + { + [client deleteACL: folderName uid: currentUID]; + currentUID = [uids nextObject]; + } +} + +- (void) setRoles: (NSArray *) roles + forUser: (NSString *) uid +{ + NSString *acls, *folderName; + + acls = [self _sogoAclsToImapAcls: roles]; + folderName = [imap4 imap4FolderNameForURL: [self imap4URL]]; + [[imap4 client] setACL: folderName rights: acls uid: uid]; +} + +- (NSString *) defaultUserID +{ + return @"anyone"; +} + +- (BOOL) hasSupportForDefaultRoles +{ + return YES; } @end /* SOGoMailFolder */ From 1854f578d8b28fd2ef9116818a468450312dbcaf Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:34:02 +0000 Subject: [PATCH 20/41] Monotone-Parent: d581866eeb3e11ed3f8c8583be73f14f00325d7e Monotone-Revision: 733898f2b6e525ffa05bcf6a3544671572ece02b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:34:02 Monotone-Branch: ca.inverse.sogo --- .../MailerUI/UIxMailUserRightsEditor.wox | 57 ++++++++++++------- UI/WebServerResources/MailerUI.js | 4 +- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox index aa83c752e..998f5b6f7 100644 --- a/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox +++ b/UI/Templates/MailerUI/UIxMailUserRightsEditor.wox @@ -22,45 +22,60 @@ />
      + +
      -
      - -
      - + label:value="Read mails from this folder"/>
      + label:value="Mark mails read and unread"/>
      + const:name="MailWriter" + var:checked="userCanWriteMails"/>
      + const:name="ObjectCreator" + var:checked="userCanInsertMails"/>
      + label:value="Post mails"/>
      +
      + +
      + +
      + +
      + + label:value="Modify the acl of this folder"/>
      diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index 0c5629e7a..075d020ce 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -5,8 +5,8 @@ var maxCachedMessages = 20; var cachedMessages = new Array(); var currentMailbox = ''; -var usersRightsWindowHeight = 250; -var usersRightsWindowWidth = 502; +var usersRightsWindowHeight = 320; +var usersRightsWindowWidth = 400; /* mail list */ From 8d65b4d244b3827f66ea2390b4f6cbf541a21e94 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:35:17 +0000 Subject: [PATCH 21/41] Monotone-Parent: 733898f2b6e525ffa05bcf6a3544671572ece02b Monotone-Revision: 42c9bd72b2fe1b4652131b0e73ac38e10f8838f1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:35:17 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++++ SoObjects/SOGo/SOGoContentObject.m | 5 +++++ SoObjects/SOGo/SOGoFolder.m | 11 +++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12b4c3aa1..53b66a3e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder -defaultUserID]): + overriden method to return @"". + + * SoObjects/SOGo/SOGoContentObject.m ([SOGoContentObject + -defaultUserID]): overriden method to return @"". + * SoObjects/Mailer/SOGoMailFolder.m ([SOGoMailFolder -aclsForUser:uid]): overriden method. ([SOGoMailFolder -removeAclsForUsers:users]): overriden method. diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index 451afdd76..e2b11a44e 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -343,6 +343,11 @@ forObjectAtPath: [self pathArrayToSoObject]]; } +- (NSString *) defaultUserID +{ + return @""; +} + - (BOOL) hasSupportForDefaultRoles { return YES; diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index 2fe7f49e7..82589842c 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -31,6 +31,8 @@ #import #import +static NSString *defaultUserID = @""; + @implementation SOGoFolder + (int) version @@ -341,8 +343,8 @@ [self _cacheRoles: acls forUser: uid forObjectAtPath: objectPath]; } - if (!([acls count] || [uid isEqualToString: SOGoDefaultUserID])) - acls = [self aclsForUser: SOGoDefaultUserID + if (!([acls count] || [uid isEqualToString: defaultUserID])) + acls = [self aclsForUser: defaultUserID forObjectAtPath: objectPathArray]; return acls; @@ -451,6 +453,11 @@ forObjectAtPath: [self pathArrayToSoObject]]; } +- (NSString *) defaultUserID +{ + return defaultUserID; +} + - (BOOL) hasSupportForDefaultRoles { return YES; From de55849a85b2bd5ab0ec276966b207111163be5f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:36:23 +0000 Subject: [PATCH 22/41] Monotone-Parent: 42c9bd72b2fe1b4652131b0e73ac38e10f8838f1 Monotone-Revision: b2df4875f87b44b55f2d9acc0193789d2b19a555 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:36:23 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoObject.h | 3 +-- SoObjects/SOGo/SOGoObject.m | 9 +++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53b66a3e8..717371285 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -defaultUserID]): new + mandatory method for subclasses. Removed the SOGoDefaultUserID + global var. + * SoObjects/SOGo/SOGoFolder.m ([SOGoFolder -defaultUserID]): overriden method to return @"". diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index 0b2360a6a..a90fdde78 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -52,8 +52,6 @@ #define $(class) NSClassFromString(class) -extern NSString *SOGoDefaultUserID; - @interface SOGoObject : NSObject { WOContext *context; @@ -106,6 +104,7 @@ extern NSString *SOGoDefaultUserID; - (void) setRoles: (NSArray *) roles forUser: (NSString *) uid; - (void) removeAclsForUsers: (NSArray *) users; +- (NSString *) defaultUserID; - (BOOL) hasSupportForDefaultRoles; /* description */ diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 6fa6c5328..27ea92d1f 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -47,8 +47,6 @@ #import "SOGoObject.h" -NSString *SOGoDefaultUserID = @""; - @interface SOGoObject(Content) - (NSString *)contentAsString; @end @@ -739,6 +737,13 @@ static BOOL kontactGroupDAV = YES; [self subclassResponsibility: _cmd]; } +- (NSString *) defaultUserID +{ + [self subclassResponsibility: _cmd]; + + return nil; +} + - (BOOL) hasSupportForDefaultRoles { return NO; From 14f48b15630fc810a82ae75f0922815fa2339336 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:38:49 +0000 Subject: [PATCH 23/41] Monotone-Parent: b2df4875f87b44b55f2d9acc0193789d2b19a555 Monotone-Revision: 3c0201014f53f29be70c0414896fda18bebaba81 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:38:49 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 + UI/MailerUI/English.lproj/Localizable.strings | 15 ++ UI/MailerUI/French.lproj/Localizable.strings | 15 ++ UI/MailerUI/UIxMailUserRightsEditor.m | 149 +++++++++++++----- 4 files changed, 146 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 717371285..4c5d7dc53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-22 Wolfgang Sourdeau + * UI/MailerUI/UIxMailUserRightsEditor.m: added all the missing + methods to support the IMAP acls mentionned in the RFC 4314, + removed the ones specific to Cyrus. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -defaultUserID]): new mandatory method for subclasses. Removed the SOGoDefaultUserID global var. diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 49ea90505..bbf54acbd 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -35,6 +35,21 @@ "Account: " = "Account: "; "Shared Account: " = "Shared Account: "; +/* acls */ +"Default Roles" = "Default Roles"; + +"List and see this folder" = "List and see this folder"; +"Read mails from this folder" = "Read mails from this folder"; +"Mark mails read and unread" = "Mark mails read and unread"; +"Modify the flags of the mails in this folder" = "Modify the flags of the mails in this folder"; +"Insert, copy and move mails into this folder" = "Insert, copy and move mails into this folder"; +"Post mails" = "Post mails"; +"Add subfolders to this folder" = "Add subfolders to this folder"; +"Remove this folder" = "Remove this folder"; +"Erase mails from this folder" = "Erase mails from this folder"; +"Expunge this folder" = "Expunge this folder"; +"Modify the acl of this folder" = "Modify the acl of this folder"; + /* Mail edition */ "From" = "From"; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index 427011508..f3ad2063a 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -34,6 +34,21 @@ "Account: " = "Compte : "; "Shared Account: " = "Compte Partagé "; +/* acls */ +"Default Roles" = "Rôles par défaut"; + +"List and see this folder" = "Lister et voir ce dossier"; +"Read mails from this folder" = "Lire les messages de ce dossier"; +"Mark mails read and unread" = "Marquer les messages comme lus ou non-lus"; +"Modify the flags of the mails in this folder" = "Modifier les indicateurs sur les messages"; +"Insert, copy and move mails into this folder" = "Insérer, copier et déplacer des messages dans ce dossier"; +"Post mails" = "Poster des messages"; +"Add subfolders to this folder" = "Ajouter des sous-dossiers à ce dossier"; +"Remove this folder" = "Effacer ce dossier"; +"Erase mails from this folder" = "Effacer des messages de ce dossier"; +"Expunge this folder" = "Compacter ce dossier"; +"Modify the acl of this folder" = "Administrer les droits sur ce dossier"; + /* Mail edition */ "From" = "De"; diff --git a/UI/MailerUI/UIxMailUserRightsEditor.m b/UI/MailerUI/UIxMailUserRightsEditor.m index f2fb91ab1..2478b5c5a 100644 --- a/UI/MailerUI/UIxMailUserRightsEditor.m +++ b/UI/MailerUI/UIxMailUserRightsEditor.m @@ -29,6 +29,19 @@ @implementation UIxMailUserRightsEditor +- (void) setUserCanSeeFolder: (BOOL) userCanSeeFolder +{ + if (userCanSeeFolder) + [self appendRight: SOGoRole_ObjectViewer]; + else + [self removeRight: SOGoRole_ObjectViewer]; +} + +- (BOOL) userCanSeeFolder +{ + return [userRights containsObject: SOGoRole_ObjectViewer]; +} + - (void) setUserCanReadMails: (BOOL) userCanReadMails { if (userCanReadMails) @@ -42,6 +55,19 @@ return [userRights containsObject: SOGoRole_ObjectReader]; } +- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead +{ + if (userCanMarkMailsRead) + [self appendRight: SOGoMailRole_SeenKeeper]; + else + [self removeRight: SOGoMailRole_SeenKeeper]; +} + +- (BOOL) userCanMarkMailsRead +{ + return [userRights containsObject: SOGoMailRole_SeenKeeper]; +} + - (void) setUserCanWriteMails: (BOOL) userCanWriteMails { if (userCanWriteMails) @@ -68,30 +94,17 @@ return [userRights containsObject: SOGoRole_ObjectCreator]; } -- (void) setUserCanMarkMailsRead: (BOOL) userCanMarkMailsRead +- (void) setUserCanPostMails: (BOOL) userCanPostMails { - if (userCanMarkMailsRead) - [self appendRight: SOGoMailRole_SeenKeeper]; + if (userCanPostMails) + [self appendRight: SOGoMailRole_Poster]; else - [self removeRight: SOGoMailRole_SeenKeeper]; + [self removeRight: SOGoMailRole_Poster]; } -- (BOOL) userCanMarkMailsRead +- (BOOL) userCanPostMails { - return [userRights containsObject: SOGoMailRole_SeenKeeper]; -} - -- (void) setUserCanEraseMails: (BOOL) userCanEraseMails -{ - if (userCanEraseMails) - [self appendRight: SOGoRole_ObjectEraser]; - else - [self removeRight: SOGoRole_ObjectEraser]; -} - -- (BOOL) userCanEraseMails -{ - return [userRights containsObject: SOGoRole_ObjectEraser]; + return [userRights containsObject: SOGoMailRole_Poster]; } - (void) setUserCanCreateSubfolders: (BOOL) userCanCreateSubfolders @@ -107,17 +120,43 @@ return [userRights containsObject: SOGoRole_FolderCreator]; } -- (void) setUserCanPostMails: (BOOL) userCanPostMails +- (void) setUserCanRemoveFolder: (BOOL) userCanRemoveFolder { - if (userCanPostMails) - [self appendRight: SOGoMailRole_Poster]; + if (userCanRemoveFolder) + [self appendRight: SOGoRole_ObjectEraser]; else - [self removeRight: SOGoMailRole_Poster]; + [self removeRight: SOGoRole_ObjectEraser]; } -- (BOOL) userCanPostMails +- (BOOL) userCanRemoveFolder { - return [userRights containsObject: SOGoMailRole_Poster]; + return [userRights containsObject: SOGoRole_ObjectEraser]; +} + +- (void) setUserCanEraseMails: (BOOL) userCanEraseMails +{ + if (userCanEraseMails) + [self appendRight: SOGoMailRole_MessageEraser]; + else + [self removeRight: SOGoMailRole_MessageEraser]; +} + +- (BOOL) userCanEraseMails +{ + return [userRights containsObject: SOGoMailRole_MessageEraser]; +} + +- (void) setUserCanExpungeFolder: (BOOL) userCanExpungeFolder +{ + if (userCanExpungeFolder) + [self appendRight: SOGoMailRole_Expunger]; + else + [self removeRight: SOGoMailRole_Expunger]; +} + +- (BOOL) userCanExpungeFolder +{ + return [userRights containsObject: SOGoMailRole_Expunger]; } - (void) setUserIsAdministrator: (BOOL) userIsAdministrator @@ -139,25 +178,61 @@ request = [context request]; - if ([[request formValueForKey: @"ObjectCreator"] length] > 0) - [self appendRight: SOGoRole_ObjectCreator]; - else - [self removeRight: SOGoRole_ObjectCreator]; - - if ([[request formValueForKey: @"ObjectEditor"] length] > 0) - [self appendRight: SOGoRole_ObjectEditor]; - else - [self removeRight: SOGoRole_ObjectEditor]; - - if ([[request formValueForKey: @"ObjectViewer"] length] > 0) + if ([[request formValueForKey: SOGoRole_ObjectViewer] length] > 0) [self appendRight: SOGoRole_ObjectViewer]; else [self removeRight: SOGoRole_ObjectViewer]; - if ([[request formValueForKey: @"ObjectEraser"] length] > 0) + if ([[request formValueForKey: SOGoRole_ObjectReader] length] > 0) + [self appendRight: SOGoRole_ObjectReader]; + else + [self removeRight: SOGoRole_ObjectReader]; + + if ([[request formValueForKey: SOGoMailRole_SeenKeeper] length] > 0) + [self appendRight: SOGoMailRole_SeenKeeper]; + else + [self removeRight: SOGoMailRole_SeenKeeper]; + + if ([[request formValueForKey: SOGoMailRole_Writer] length] > 0) + [self appendRight: SOGoMailRole_Writer]; + else + [self removeRight: SOGoMailRole_Writer]; + + if ([[request formValueForKey: SOGoRole_ObjectCreator] length] > 0) + [self appendRight: SOGoRole_ObjectCreator]; + else + [self removeRight: SOGoRole_ObjectCreator]; + + if ([[request formValueForKey: SOGoMailRole_Poster] length] > 0) + [self appendRight: SOGoMailRole_Poster]; + else + [self removeRight: SOGoMailRole_Poster]; + + if ([[request formValueForKey: SOGoRole_FolderCreator] length] > 0) + [self appendRight: SOGoRole_FolderCreator]; + else + [self removeRight: SOGoRole_FolderCreator]; + + if ([[request formValueForKey: SOGoRole_ObjectEraser] length] > 0) [self appendRight: SOGoRole_ObjectEraser]; else [self removeRight: SOGoRole_ObjectEraser]; + + if ([[request formValueForKey: SOGoMailRole_MessageEraser] length] > 0) + [self appendRight: SOGoMailRole_MessageEraser]; + else + [self removeRight: SOGoMailRole_MessageEraser]; + + if ([[request formValueForKey: SOGoMailRole_Expunger] length] > 0) + [self appendRight: SOGoMailRole_Expunger]; + else + [self removeRight: SOGoMailRole_Expunger]; + + if ([[request formValueForKey: SOGoMailRole_Administrator] length] > 0) + [self appendRight: SOGoMailRole_Administrator]; + else + [self removeRight: SOGoMailRole_Administrator]; } @end + From 011026910462a4f908d9bf2f0702a5f76698033d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:40:05 +0000 Subject: [PATCH 24/41] Monotone-Parent: 3c0201014f53f29be70c0414896fda18bebaba81 Monotone-Revision: 89e96558858b2cf13a764624a48709a6ae445040 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:40:05 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Common/UIxUserRightsEditor.h | 1 + UI/Common/UIxUserRightsEditor.m | 12 ++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c5d7dc53..a66e10574 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-22 Wolfgang Sourdeau + * UI/Common/UIxUserRightsEditor.m ([UIxUserRightsEditor -userIsDefaultUser]) + ([UIxUserRightsEditor -_initRights]): take the new SOGoObject's + "defaultUserID" method into account. + * UI/MailerUI/UIxMailUserRightsEditor.m: added all the missing methods to support the IMAP acls mentionned in the RFC 4314, removed the ones specific to Cyrus. diff --git a/UI/Common/UIxUserRightsEditor.h b/UI/Common/UIxUserRightsEditor.h index 35cfe1568..0bef18e57 100644 --- a/UI/Common/UIxUserRightsEditor.h +++ b/UI/Common/UIxUserRightsEditor.h @@ -34,6 +34,7 @@ { NSMutableArray *userRights; NSString *uid; + NSString *defaultUserID; } - (NSString *) userDisplayName; diff --git a/UI/Common/UIxUserRightsEditor.m b/UI/Common/UIxUserRightsEditor.m index 8ec44dd46..10b1be909 100644 --- a/UI/Common/UIxUserRightsEditor.m +++ b/UI/Common/UIxUserRightsEditor.m @@ -25,6 +25,7 @@ #import #import #import +#import #import "UIxUserRightsEditor.h" @@ -36,6 +37,7 @@ { uid = nil; userRights = [NSMutableArray new]; + defaultUserID = nil; } return self; @@ -55,7 +57,10 @@ - (BOOL) userIsDefaultUser { - return [uid isEqualToString: SOGoDefaultUserID]; + if (!defaultUserID) + ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); + + return [uid isEqualToString: defaultUserID]; } - (NSString *) userDisplayName @@ -82,8 +87,11 @@ newUID = [[context request] formValueForKey: @"uid"]; if ([newUID length] > 0) { + if (!defaultUserID) + ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); + um = [LDAPUserManager sharedUserManager]; - if ([newUID isEqualToString: SOGoDefaultUserID] + if ([newUID isEqualToString: defaultUserID] || [[um getEmailForUID: newUID] length] > 0) { ASSIGN (uid, newUID); From 7fe5e9fc6f4f6d1dbf3c46b9d26d71c3925e9eb7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:40:45 +0000 Subject: [PATCH 25/41] Monotone-Parent: 89e96558858b2cf13a764624a48709a6ae445040 Monotone-Revision: 2aa515f85c333b96d717d00a46fabb09517fd9c0 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:40:45 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Common/UIxAclEditor.h | 1 + UI/Common/UIxAclEditor.m | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a66e10574..8aac17655 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-22 Wolfgang Sourdeau + * UI/Common/UIxAclEditor.m ([UIxAclEditor -defaultUserID]) + ([UIxAclEditor -_prepareUsers]): take the new SOGoObject's + "defaultUserID" method into account. + * UI/Common/UIxUserRightsEditor.m ([UIxUserRightsEditor -userIsDefaultUser]) ([UIxUserRightsEditor -_initRights]): take the new SOGoObject's "defaultUserID" method into account. diff --git a/UI/Common/UIxAclEditor.h b/UI/Common/UIxAclEditor.h index 72a34dbaf..f8104ceed 100644 --- a/UI/Common/UIxAclEditor.h +++ b/UI/Common/UIxAclEditor.h @@ -33,6 +33,7 @@ NSArray *savedUIDs; NSMutableArray *users; NSString *currentUser; + NSString *defaultUserID; } - (NSArray *) aclsForObject; diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index e87a15259..f525b66fd 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -87,7 +87,10 @@ - (NSString *) defaultUserID { - return SOGoDefaultUserID; + if (!defaultUserID) + ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); + + return defaultUserID; } - (void) _prepareUsers @@ -96,16 +99,19 @@ NSString *currentUID, *ownerLogin; ownerLogin = [[self clientObject] ownerInContext: context]; + if (!defaultUserID) + ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); aclsEnum = [[self aclsForObject] objectEnumerator]; currentUID = [aclsEnum nextObject]; while (currentUID) { if (!([currentUID isEqualToString: ownerLogin] - || [currentUID isEqualToString: SOGoDefaultUserID])) + || [currentUID isEqualToString: defaultUserID])) [users addObjectUniquely: currentUID]; currentUID = [aclsEnum nextObject]; } + prepared = YES; } From 46d95e44e83d3b70da03721e174fb6eb905a50d7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:41:02 +0000 Subject: [PATCH 26/41] Monotone-Parent: 2aa515f85c333b96d717d00a46fabb09517fd9c0 Monotone-Revision: 9b43bde07802307f5699569cd53b92baa4d95757 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:41:02 Monotone-Branch: ca.inverse.sogo --- UI/MailPartViewers/UIxMailPartTextViewer.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/UI/MailPartViewers/UIxMailPartTextViewer.m b/UI/MailPartViewers/UIxMailPartTextViewer.m index ae25992ef..e6d7e66a2 100644 --- a/UI/MailPartViewers/UIxMailPartTextViewer.m +++ b/UI/MailPartViewers/UIxMailPartTextViewer.m @@ -39,9 +39,7 @@ - (NSString *) flatContentAsString { NSMutableString *content; - NSString *superContent, *urlText, *newUrlText; - NSRange httpRange, rest, currentURL; - unsigned int length; + NSString *superContent; content = [NSMutableString string]; superContent = [[super flatContentAsString] stringByEscapingHTMLString]; From c5273a7b89a874ce709f81764e520367f21f2efd Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 18:41:51 +0000 Subject: [PATCH 27/41] Monotone-Parent: 9b43bde07802307f5699569cd53b92baa4d95757 Monotone-Revision: d67a1be162ebbbb10019193a93b1214b78a51d94 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T18:41:51 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/SOGo/SOGoPermissions.h | 4 ++-- SoObjects/SOGo/SOGoPermissions.m | 13 +++++++------ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8aac17655..b82665af8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoPermissions.m: added the new role + "SOGoMailRole_MessageEraser". + * UI/Common/UIxAclEditor.m ([UIxAclEditor -defaultUserID]) ([UIxAclEditor -_prepareUsers]): take the new SOGoObject's "defaultUserID" method into account. diff --git a/SoObjects/SOGo/SOGoPermissions.h b/SoObjects/SOGo/SOGoPermissions.h index aaa31af54..2b4e60cf5 100644 --- a/SoObjects/SOGo/SOGoPermissions.h +++ b/SoObjects/SOGo/SOGoPermissions.h @@ -32,9 +32,8 @@ extern NSString *SOGoRole_ObjectReader; extern NSString *SOGoRole_ObjectEraser; extern NSString *SOGoRole_ObjectViewer; extern NSString *SOGoRole_ObjectEditor; + extern NSString *SOGoRole_FolderCreator; -extern NSString *SOGoRole_FolderEraser; -extern NSString *SOGoRole_FolderViewer; extern NSString *SOGoRole_FolderReader; extern NSString *SOGoRole_AuthorizedSubscriber; extern NSString *SOGoRole_None; @@ -47,6 +46,7 @@ extern NSString *SOGoMailRole_Poster; extern NSString *SOGoMailRole_Expunger; extern NSString *SOGoMailRole_Creator; extern NSString *SOGoMailRole_Administrator; +extern NSString *SOGoMailRole_MessageEraser; extern NSString *SOGoCalendarRole_Organizer; extern NSString *SOGoCalendarRole_Participant; diff --git a/SoObjects/SOGo/SOGoPermissions.m b/SoObjects/SOGo/SOGoPermissions.m index a20e68168..f5cb1f172 100644 --- a/SoObjects/SOGo/SOGoPermissions.m +++ b/SoObjects/SOGo/SOGoPermissions.m @@ -28,7 +28,7 @@ NSString *SOGoRole_ObjectEraser = @"ObjectEraser"; NSString *SOGoRole_ObjectViewer = @"ObjectViewer"; NSString *SOGoRole_ObjectReader = @"ObjectReader"; NSString *SOGoRole_ObjectEditor = @"ObjectEditor"; -NSString *SOGoRole_FolderCreator = @"FolderCreate"; +NSString *SOGoRole_FolderCreator = @"FolderCreator"; NSString *SOGoRole_FolderEraser = @"FolderEraser"; NSString *SOGoRole_FolderViewer = @"FolderViewer"; NSString *SOGoRole_FolderReader = @"FolderReader"; @@ -65,11 +65,12 @@ NSString *SOGoCalendarRole_ComponentDAndTViewer = @"ComponentDAndTViewer"; NSString *SOGoCalendarRole_ComponentModifier = @"ComponentModifier"; NSString *SOGoCalendarRole_ComponentResponder = @"ComponentResponder"; -NSString *SOGoMailRole_SeenKeeper = @"SeenKeeper"; -NSString *SOGoMailRole_Writer = @"Writer"; -NSString *SOGoMailRole_Poster = @"Poster"; -NSString *SOGoMailRole_Expunger = @"Expunger"; -NSString *SOGoMailRole_Administrator = @"Administrator"; +NSString *SOGoMailRole_SeenKeeper = @"MailSeenKeeper"; +NSString *SOGoMailRole_Writer = @"MailWriter"; +NSString *SOGoMailRole_Poster = @"MailPoster"; +NSString *SOGoMailRole_Expunger = @"MailExpunger"; +NSString *SOGoMailRole_Administrator = @"MailAdministrator"; +NSString *SOGoMailRole_MessageEraser = @"MailMessageEraser"; /* permissions */ NSString *SOGoPerm_ReadAcls = @"ReadAcls"; /* the equivalent of "read-acl" in From a19c154873e9d1bd2f1564532c65dfcb60f04a7b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:03:29 +0000 Subject: [PATCH 28/41] Monotone-Parent: d67a1be162ebbbb10019193a93b1214b78a51d94 Monotone-Revision: eb2a31ca341c6716a5121507df99f820e15f17f2 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:03:29 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/generic.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/UI/WebServerResources/generic.css b/UI/WebServerResources/generic.css index a15911de1..19c19b1af 100644 --- a/UI/WebServerResources/generic.css +++ b/UI/WebServerResources/generic.css @@ -218,8 +218,6 @@ DIV#toolbar white-space: nowrap; overflow: auto; } -BODY.popup { min-width: 400px; } - BODY.popup DIV#toolbar { border-top: 0px; } From c7545b5e9e1d281e14bb3368667c49480e248964 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:16:07 +0000 Subject: [PATCH 29/41] Monotone-Parent: eb2a31ca341c6716a5121507df99f820e15f17f2 Monotone-Revision: c204736a5f5dcfce7b1fd9db8327cbe1ff79c7aa Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:16:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/Appointments/SOGoAppointmentFolder.m | 9 --------- SoObjects/Mailer/SOGoMailFolder.m | 16 ++++++++-------- SoObjects/SOGo/SOGoFolder.m | 6 ------ SoObjects/SOGo/SOGoObject.h | 1 - SoObjects/SOGo/SOGoObject.m | 7 ------- UI/Common/UIxUserRightsEditor.m | 5 ----- 7 files changed, 11 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index b82665af8..666e9294d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -defaultAclRoles]): + removed method. + * SoObjects/SOGo/SOGoPermissions.m: added the new role "SOGoMailRole_MessageEraser". diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index 5d708c38f..a2cea22ac 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1296,13 +1296,4 @@ static NSNumber *sharedYes = nil; return @"IPF.Appointment"; } -/* acls */ -- (NSArray *) defaultAclRoles -{ - return [NSArray arrayWithObjects: - SOGoCalendarRole_PublicViewer, - SOGoCalendarRole_ConfidentialDAndTViewer, - nil]; -} - @end /* SOGoAppointmentFolder */ diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index b44cbf448..ba69e9993 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -39,6 +39,8 @@ #import "SOGoMailFolderDataSource.h" #import "SOGoMailFolder.h" +static NSString *defaultUserID = @"anyone"; + @implementation SOGoMailFolder static BOOL useAltNamespace = NO; @@ -428,16 +430,14 @@ static BOOL useAltNamespace = NO; - (NSArray *) aclsForUser: (NSString *) uid { NSDictionary *imapAcls; + NSArray *userAcls; imapAcls = [imap4 aclForMailboxAtURL: [self imap4URL]]; + userAcls = [imapAcls objectForKey: uid]; + if (!([userAcls count] || [uid isEqualToString: defaultUserID])) + userAcls = [imapAcls objectForKey: defaultUserID]; - return [self _imapAclsToSOGoAcls: [imapAcls objectForKey: uid]]; -} - -- (NSArray *) defaultAclRoles -{ - return [NSArray arrayWithObjects: SOGoRole_ObjectViewer, - SOGoRole_ObjectReader, SOGoMailRole_SeenKeeper, nil]; + return [self _imapAclsToSOGoAcls: userAcls]; } - (void) removeAclsForUsers: (NSArray *) users @@ -471,7 +471,7 @@ static BOOL useAltNamespace = NO; - (NSString *) defaultUserID { - return @"anyone"; + return defaultUserID; } - (BOOL) hasSupportForDefaultRoles diff --git a/SoObjects/SOGo/SOGoFolder.m b/SoObjects/SOGo/SOGoFolder.m index 82589842c..2e3b7469f 100644 --- a/SoObjects/SOGo/SOGoFolder.m +++ b/SoObjects/SOGo/SOGoFolder.m @@ -422,12 +422,6 @@ static NSString *defaultUserID = @""; } /* acls */ -- (NSArray *) defaultAclRoles -{ -#warning this should be changed to something useful - return nil; -} - - (NSArray *) aclUsers { return [self aclUsersForObjectAtPath: [self pathArrayToSoObject]]; diff --git a/SoObjects/SOGo/SOGoObject.h b/SoObjects/SOGo/SOGoObject.h index a90fdde78..b265699ef 100644 --- a/SoObjects/SOGo/SOGoObject.h +++ b/SoObjects/SOGo/SOGoObject.h @@ -98,7 +98,6 @@ /* acls */ -- (NSArray *) defaultAclRoles; - (NSArray *) aclUsers; - (NSArray *) aclsForUser: (NSString *) uid; - (void) setRoles: (NSArray *) roles diff --git a/SoObjects/SOGo/SOGoObject.m b/SoObjects/SOGo/SOGoObject.m index 27ea92d1f..5ca5809f7 100644 --- a/SoObjects/SOGo/SOGoObject.m +++ b/SoObjects/SOGo/SOGoObject.m @@ -719,13 +719,6 @@ static BOOL kontactGroupDAV = YES; return nil; } -- (NSArray *) defaultAclRoles -{ - [self subclassResponsibility: _cmd]; - - return nil; -} - - (void) setRoles: (NSArray *) roles forUser: (NSString *) uid { diff --git a/UI/Common/UIxUserRightsEditor.m b/UI/Common/UIxUserRightsEditor.m index 10b1be909..4146b30da 100644 --- a/UI/Common/UIxUserRightsEditor.m +++ b/UI/Common/UIxUserRightsEditor.m @@ -80,7 +80,6 @@ NSString *newUID; LDAPUserManager *um; SOGoObject *clientObject; - unsigned int count; response = NO; @@ -97,10 +96,6 @@ ASSIGN (uid, newUID); clientObject = [self clientObject]; [userRights addObjectsFromArray: [clientObject aclsForUser: uid]]; - count = [userRights count]; - if (!count || (count == 1 && [[userRights objectAtIndex: 0] - isEqualToString: SOGoRole_None])) - [userRights setArray: [clientObject defaultAclRoles]]; response = YES; } From 71ac2d19bbb0e05a536863cfc94ba89f6d6bb970 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:16:58 +0000 Subject: [PATCH 30/41] Monotone-Parent: c204736a5f5dcfce7b1fd9db8327cbe1ff79c7aa Monotone-Revision: 70c743d917ef016d30989ee6038dc08f22b4d212 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:16:58 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 3 +++ SoObjects/Mailer/SOGoMailObject.m | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 666e9294d..c142c23e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2007-05-22 Wolfgang Sourdeau + * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject + -isDeletionAllowed]): completed method with the new imap acl api. + * SoObjects/SOGo/SOGoObject.m ([SOGoObject -defaultAclRoles]): removed method. diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index 14af16563..d0d29c05e 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -639,10 +639,15 @@ static BOOL debugSoParts = NO; /* permissions */ -- (BOOL)isDeletionAllowed { -#warning b0000ooo - return YES; -// return [[self container] isDeleteAndExpungeAllowed]; +- (BOOL) isDeletionAllowed +{ + NSArray *parentAcls; + NSString *login; + + login = [[context activeUser] login]; + parentAcl = [[self container] aclsForUser: login]; + + return [parentAcl containsObject: SOGoMailRole_MessageEraser]; } /* name lookup */ From 35ee1a591998a613b9d5c0ec5dc5dd90404e9b8e Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:17:45 +0000 Subject: [PATCH 31/41] Monotone-Parent: 70c743d917ef016d30989ee6038dc08f22b4d212 Monotone-Revision: ecd42cf765d6bff1717939e5c8e669ef2dbd23f7 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:17:45 Monotone-Branch: ca.inverse.sogo --- SoObjects/Mailer/SOGoMailFolder.m | 34 +++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index ba69e9993..b3c37b65c 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -60,9 +60,9 @@ static BOOL useAltNamespace = NO; } - (void)dealloc { - [self->selectInfo release]; - [self->filenames release]; - [self->folderType release]; + [selectInfo release]; + [filenames release]; + [folderType release]; [super dealloc]; } @@ -82,15 +82,15 @@ static BOOL useAltNamespace = NO; NSArray *uids; unsigned count; - if (self->filenames != nil) - return [self->filenames isNotNull] ? self->filenames : nil; + if (filenames != nil) + return [filenames isNotNull] ? filenames : nil; uids = [self fetchUIDsMatchingQualifier:nil sortOrdering:@"DATE"]; if ([uids isKindOfClass:[NSException class]]) return nil; if ((count = [uids count]) == 0) { - self->filenames = [[NSArray alloc] init]; + filenames = [[NSArray alloc] init]; } else { NSMutableArray *keys; @@ -104,10 +104,10 @@ static BOOL useAltNamespace = NO; k = [k stringByAppendingString:@".mail"]; [keys addObject:k]; } - self->filenames = [keys copy]; + filenames = [keys copy]; [keys release]; } - return self->filenames; + return filenames; } - (EODataSource *)contentDataSourceInContext:(id)_ctx { @@ -124,14 +124,14 @@ static BOOL useAltNamespace = NO; /* returns nil if fetch was successful */ id info; - if (self->selectInfo != nil) + if (selectInfo != nil) return nil; /* select info exists, => no error */ info = [[self imap4Connection] infoForMailboxAtURL:[self imap4URL]]; if ([info isKindOfClass:[NSException class]]) return info; - self->selectInfo = [info retain]; + selectInfo = [info retain]; return nil; /* no error */ } @@ -302,22 +302,22 @@ static BOOL useAltNamespace = NO; SOGoMailAccount *account; NSString *n; - if (self->folderType != nil) - return self->folderType; + if (folderType != nil) + return folderType; account = [self mailAccountFolder]; n = [self nameInContainer]; if ([n isEqualToString:[account trashFolderNameInContext:nil]]) - self->folderType = @"IPF.Trash"; + folderType = @"IPF.Trash"; else if ([n isEqualToString:[account inboxFolderNameInContext:nil]]) - self->folderType = @"IPF.Inbox"; + folderType = @"IPF.Inbox"; else if ([n isEqualToString:[account sentFolderNameInContext:nil]]) - self->folderType = @"IPF.Sent"; + folderType = @"IPF.Sent"; else - self->folderType = @"IPF.Folder"; + folderType = @"IPF.Folder"; - return self->folderType; + return folderType; } /* acls */ From a8c74de4fc9cbb8973786125f3e5298089ff39d3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 19:30:36 +0000 Subject: [PATCH 32/41] Monotone-Parent: ecd42cf765d6bff1717939e5c8e669ef2dbd23f7 Monotone-Revision: 1b8346cb8f33985ba53c8fb47eb2c306c66aaa13 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T19:30:36 Monotone-Branch: ca.inverse.sogo --- SoObjects/Mailer/SOGoMailFolder.m | 4 ++-- SoObjects/Mailer/SOGoMailObject.m | 40 +++++++++++++++++++++++-------- UI/Common/UIxAclEditor.m | 2 ++ UI/Common/UIxUserRightsEditor.m | 1 + 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/SoObjects/Mailer/SOGoMailFolder.m b/SoObjects/Mailer/SOGoMailFolder.m index b3c37b65c..6c7c84cb1 100644 --- a/SoObjects/Mailer/SOGoMailFolder.m +++ b/SoObjects/Mailer/SOGoMailFolder.m @@ -430,11 +430,11 @@ static BOOL useAltNamespace = NO; - (NSArray *) aclsForUser: (NSString *) uid { NSDictionary *imapAcls; - NSArray *userAcls; + NSString *userAcls; imapAcls = [imap4 aclForMailboxAtURL: [self imap4URL]]; userAcls = [imapAcls objectForKey: uid]; - if (!([userAcls count] || [uid isEqualToString: defaultUserID])) + if (!([userAcls length] || [uid isEqualToString: defaultUserID])) userAcls = [imapAcls objectForKey: defaultUserID]; return [self _imapAclsToSOGoAcls: userAcls]; diff --git a/SoObjects/Mailer/SOGoMailObject.m b/SoObjects/Mailer/SOGoMailObject.m index d0d29c05e..68ec6326a 100644 --- a/SoObjects/Mailer/SOGoMailObject.m +++ b/SoObjects/Mailer/SOGoMailObject.m @@ -19,15 +19,35 @@ 02111-1307, USA. */ -#include "SOGoMailObject.h" -#include "SOGoMailFolder.h" -#include "SOGoMailAccount.h" -#include "SOGoMailManager.h" -#include "SOGoMailBodyPart.h" -#include -#include -#include -#include "common.h" +#import +#import +#import +#import +#import +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#import +#import +#import "SOGoMailFolder.h" +#import "SOGoMailAccount.h" +#import "SOGoMailManager.h" +#import "SOGoMailBodyPart.h" + +#import "SOGoMailObject.h" @implementation SOGoMailObject @@ -641,7 +661,7 @@ static BOOL debugSoParts = NO; - (BOOL) isDeletionAllowed { - NSArray *parentAcls; + NSArray *parentAcl; NSString *login; login = [[context activeUser] login]; diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index f525b66fd..e6dccdfe0 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -44,6 +44,7 @@ publishInFreeBusy = NO; users = [NSMutableArray new]; currentUser = nil; + defaultUserID = nil; savedUIDs = nil; } @@ -55,6 +56,7 @@ [savedUIDs release]; [users release]; [currentUser release]; + [defaultUserID release]; [super dealloc]; } diff --git a/UI/Common/UIxUserRightsEditor.m b/UI/Common/UIxUserRightsEditor.m index 4146b30da..ad674f63e 100644 --- a/UI/Common/UIxUserRightsEditor.m +++ b/UI/Common/UIxUserRightsEditor.m @@ -47,6 +47,7 @@ { [uid release]; [userRights release]; + [defaultUserID release]; [super dealloc]; } From 40914816ecd536fafa83b39d5782abcd564eeb82 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 22 May 2007 22:33:47 +0000 Subject: [PATCH 33/41] Monotone-Parent: 1b8346cb8f33985ba53c8fb47eb2c306c66aaa13 Monotone-Revision: 58e78126183c1ff9ea959547093ca49f4c4e57d1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-22T22:33:47 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/English.lproj/Localizable.strings | 3 +++ UI/MailerUI/French.lproj/Localizable.strings | 3 +++ 2 files changed, 6 insertions(+) diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index bbf54acbd..b7c739f71 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -50,6 +50,9 @@ "Expunge this folder" = "Expunge this folder"; "Modify the acl of this folder" = "Modify the acl of this folder"; +"Update" = "Update"; +"Cancel" = "Cancel"; + /* Mail edition */ "From" = "From"; diff --git a/UI/MailerUI/French.lproj/Localizable.strings b/UI/MailerUI/French.lproj/Localizable.strings index f3ad2063a..f313571c3 100644 --- a/UI/MailerUI/French.lproj/Localizable.strings +++ b/UI/MailerUI/French.lproj/Localizable.strings @@ -49,6 +49,9 @@ "Expunge this folder" = "Compacter ce dossier"; "Modify the acl of this folder" = "Administrer les droits sur ce dossier"; +"Update" = "Mettre à jour"; +"Cancel" = "Annuler"; + /* Mail edition */ "From" = "De"; From 1d31dccfcd65a65093a1cd56e89805a0ec52336d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 23 May 2007 05:29:54 +0000 Subject: [PATCH 34/41] Monotone-Parent: 58e78126183c1ff9ea959547093ca49f4c4e57d1 Monotone-Revision: 5b99bc42878b3f6237ea28ddfc15c31378ca515d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-23T05:29:54 Monotone-Branch: ca.inverse.sogo --- SoObjects/Appointments/SOGoCalendarComponent.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 9e8c841e6..14267daf8 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -513,7 +513,7 @@ static BOOL sendEMailNotifications = NO; iCalPerson *currentPerson; NSEnumerator *persons; NSMutableArray *uids; - NSString *email; + NSString *email, *uid; LDAPUserManager *um; uids = [NSMutableArray array]; @@ -523,8 +523,9 @@ static BOOL sendEMailNotifications = NO; currentPerson = [persons nextObject]; while (currentPerson) { - email = [currentPerson rfc822Email]; - [uids addObject: [um getUIDForEmail: email]]; + uid = [um getUIDForEmail: [currentPerson rfc822Email]]; + if (uid) + [uids addObject: uid]; currentPerson = [persons nextObject]; } From 0b68982f4a1dc2f2226b42f3680bd3f815ef8ec1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 23 May 2007 13:55:39 +0000 Subject: [PATCH 35/41] Monotone-Parent: 5b99bc42878b3f6237ea28ddfc15c31378ca515d Monotone-Revision: e31aad6945d9004d89dcbc916e65c898d4c56ed6 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-23T13:55:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index c142c23e5..01566a18a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-05-23 Wolfgang Sourdeau + + * SoObjects/Appointments/SOGoCalendarComponent.m + ([SOGoCalendarComponent -getUIDsForICalPersons:iCalPersons]): add + the uid to the list only when the user email is recognized by the + user manager. + 2007-05-22 Wolfgang Sourdeau * SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject From ca146b8bb4faf38a3d83eab91db899c150902b14 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 23 May 2007 18:32:22 +0000 Subject: [PATCH 36/41] Monotone-Parent: e31aad6945d9004d89dcbc916e65c898d4c56ed6 Monotone-Revision: e47f97fad469d729fdfd2a0cafcd544ed689b0eb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-23T18:32:22 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 + UI/MailerUI/UIxMailSplashView.m | 29 ------------- UI/MailerUI/product.plist | 18 +++----- UI/Templates/MailerUI/UIxMailAccountView.wox | 43 -------------------- UI/Templates/MailerUI/UIxMailSplashView.wox | 43 -------------------- 5 files changed, 7 insertions(+), 128 deletions(-) delete mode 100644 UI/MailerUI/UIxMailSplashView.m delete mode 100644 UI/Templates/MailerUI/UIxMailAccountView.wox delete mode 100644 UI/Templates/MailerUI/UIxMailSplashView.wox diff --git a/ChangeLog b/ChangeLog index 01566a18a..bb9b8fbc3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2007-05-23 Wolfgang Sourdeau + * UI/MailerUI/UIxMailSplashView.m: removed. + * SoObjects/Appointments/SOGoCalendarComponent.m ([SOGoCalendarComponent -getUIDsForICalPersons:iCalPersons]): add the uid to the list only when the user email is recognized by the diff --git a/UI/MailerUI/UIxMailSplashView.m b/UI/MailerUI/UIxMailSplashView.m deleted file mode 100644 index 628011889..000000000 --- a/UI/MailerUI/UIxMailSplashView.m +++ /dev/null @@ -1,29 +0,0 @@ -/* UIxMailSplashView - this file is part of SOGo - * - * Copyright (C) 2006 Inverse groupe conseil - * - * Author: Wolfgang Sourdeau - * - * This file is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * This file 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; see the file COPYING. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#import - -@interface UIxMailSplashView : UIxComponent -@end - -@implementation UIxMailSplashView -@end /* UIxMailSplashView */ diff --git a/UI/MailerUI/product.plist b/UI/MailerUI/product.plist index ea820f5b6..1f44d4698 100644 --- a/UI/MailerUI/product.plist +++ b/UI/MailerUI/product.plist @@ -260,24 +260,16 @@ }; }; methods = { - view = { - protectedBy = "View"; - pageName = "UIxMailAccountView"; - }; - getMail = { - protectedBy = "View"; - pageName = "UIxMailAccountView"; - }; compose = { protectedBy = "View"; actionClass = "UIxMailEditorAction"; actionName = "compose"; }; - createFolder = { - protectedBy = "View"; - pageName = "UIxMailAccountView"; - actionName = "createFolder"; - }; + mailboxes = { + protectedBy = "View"; + pageName = "UIxMailAccountView"; + actionName = "listMailboxes"; + }; }; }; diff --git a/UI/Templates/MailerUI/UIxMailAccountView.wox b/UI/Templates/MailerUI/UIxMailAccountView.wox deleted file mode 100644 index 26cef689e..000000000 --- a/UI/Templates/MailerUI/UIxMailAccountView.wox +++ /dev/null @@ -1,43 +0,0 @@ - -
      -

      - SOGo Mail - - - - - - -

      - -
      - - -
      -
      - -

      Email

      -

      -
      -
      -

      - -

      Accounts

      -

      - View settings for this account
      - Create a new account [TBD: not in Agenor]
      -

      - -

      Advanced Features

      -

      - Search messages
      - Manage message filters
      - Manage folder subscriptions
      - Offline settings [TBD: not in Agenor]
      -

      -
      diff --git a/UI/Templates/MailerUI/UIxMailSplashView.wox b/UI/Templates/MailerUI/UIxMailSplashView.wox deleted file mode 100644 index 26cef689e..000000000 --- a/UI/Templates/MailerUI/UIxMailSplashView.wox +++ /dev/null @@ -1,43 +0,0 @@ - -
      -

      - SOGo Mail - - - - - - -

      - -
      - - -
      -
      - -

      Email

      -

      -
      -
      -

      - -

      Accounts

      -

      - View settings for this account
      - Create a new account [TBD: not in Agenor]
      -

      - -

      Advanced Features

      -

      - Search messages
      - Manage message filters
      - Manage folder subscriptions
      - Offline settings [TBD: not in Agenor]
      -

      -
      From cdb725f276ec903808f6c6b0b666360168cf97d5 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 23 May 2007 18:32:39 +0000 Subject: [PATCH 37/41] Monotone-Parent: e47f97fad469d729fdfd2a0cafcd544ed689b0eb Monotone-Revision: 8713b03b75cde71f5a7dbc54ba1bf52054a6fe03 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-23T18:32:39 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/GNUmakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/UI/MailerUI/GNUmakefile b/UI/MailerUI/GNUmakefile index b8e7a4b8b..c917d42c5 100644 --- a/UI/MailerUI/GNUmakefile +++ b/UI/MailerUI/GNUmakefile @@ -21,7 +21,6 @@ MailerUI_OBJC_FILES += \ UIxMailTreeBlock.m \ UIxMailTreeBlockJS.m \ UIxMailFolderMenu.m \ - UIxMailSplashView.m \ \ UIxMailListView.m \ UIxMailView.m \ From 4c611b60cb49bca40883a6ff3f0ae8c28547834d Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 23 May 2007 18:33:24 +0000 Subject: [PATCH 38/41] Monotone-Parent: 8713b03b75cde71f5a7dbc54ba1bf52054a6fe03 Monotone-Revision: d898546bf54d1d66a7825be7dacc2945070eecf5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-23T18:33:24 Monotone-Branch: ca.inverse.sogo --- UI/MailerUI/MailerUIProduct.m | 3 --- 1 file changed, 3 deletions(-) diff --git a/UI/MailerUI/MailerUIProduct.m b/UI/MailerUI/MailerUIProduct.m index 05c33d988..031a7dd78 100644 --- a/UI/MailerUI/MailerUIProduct.m +++ b/UI/MailerUI/MailerUIProduct.m @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: MailerUIProduct.m 603 2005-02-22 23:12:45Z helge $ #import @@ -28,7 +27,5 @@ @end -#include "common.h" - @implementation MailerUIProduct @end /* MailerUIProduct */ From 024c0c79dd6f003ddd04b6ea90052c8fcc5efa58 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 25 May 2007 14:25:34 +0000 Subject: [PATCH 39/41] Monotone-Parent: d898546bf54d1d66a7825be7dacc2945070eecf5 Monotone-Revision: b9ab04e24ca5e937284497ebb1577596987b10a3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T14:25:34 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/generic.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/UI/WebServerResources/generic.js b/UI/WebServerResources/generic.js index 7943f2f2a..5a36bda9e 100644 --- a/UI/WebServerResources/generic.js +++ b/UI/WebServerResources/generic.js @@ -573,8 +573,14 @@ function log(message) { logWindow = logWindow.opener; } var logConsole = logWindow.document.getElementById("logConsole"); - if (logConsole) - logConsole.innerHTML += message.replace("<", "<", "g") + '
      ' + "\n"; + if (logConsole) { + var logMessage = message.replace("<", "<", "g"); + logMessage = logMessage.replace("\r\n", "
      \n", "g"); + logMessage = logMessage.replace("\n", "
      \n", "g"); + logMessage = logMessage.replace(" ", " ", "g"); + logMessage += '
      ' + "\n"; + logConsole.innerHTML += logMessage; + } } function backtrace() { From c9029a0001fe18e22ef0de32db0d15ad0d10f311 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 25 May 2007 14:26:24 +0000 Subject: [PATCH 40/41] Monotone-Parent: b9ab04e24ca5e937284497ebb1577596987b10a3 Monotone-Revision: d5d527cabbc7f280c54fbbfb2ede75e79fdb8d0c Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T14:26:24 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/JavascriptAPIExtensions.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/UI/WebServerResources/JavascriptAPIExtensions.js b/UI/WebServerResources/JavascriptAPIExtensions.js index fc7649ab8..088a7f10a 100644 --- a/UI/WebServerResources/JavascriptAPIExtensions.js +++ b/UI/WebServerResources/JavascriptAPIExtensions.js @@ -2,6 +2,15 @@ String.prototype.trim = function() { return this.replace(/(^\s+|\s+$)/g, ''); } +String.prototype.repeat = function(count) { + var newString = ""; + for (var i = 0; i < count; i++) { + newString += this; + } + + return newString; +} + String.prototype.capitalize = function() { return this.replace(/\w+/g, function(a) { From 3a820910268f4b4154a8cc4c6853ff5c7a6c6b21 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 25 May 2007 14:30:07 +0000 Subject: [PATCH 41/41] Monotone-Parent: d5d527cabbc7f280c54fbbfb2ede75e79fdb8d0c Monotone-Revision: bee60405e7b87d3e239c75247535e09b1a7e0943 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T14:30:07 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/submenu-disabled.gif | Bin 0 -> 54 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 UI/WebServerResources/submenu-disabled.gif diff --git a/UI/WebServerResources/submenu-disabled.gif b/UI/WebServerResources/submenu-disabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..f24a802f0404daf1ce029d856b9688b0074a4aec GIT binary patch literal 54 zcmZ?wbhEHb