From e328d43403576e3f0af4e092ac5de68d026c1273 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Tue, 23 Feb 2016 10:20:10 -0500 Subject: [PATCH] Fix ACL editor for authenticated users in Mailer --- NEWS | 1 + UI/Common/UIxAclEditor.m | 12 ++++++------ UI/Templates/UIxAclEditor.wox | 6 +++++- UI/WebServerResources/js/Common/AclController.js | 2 +- UI/WebServerResources/js/Common/User.service.js | 16 ++++++++++++---- 5 files changed, 25 insertions(+), 12 deletions(-) diff --git a/NEWS b/NEWS index 8d4d2e018..c2dd98748 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,7 @@ Bug fixes - [web] fixed mail draft autosave in preferences (#3519) - [web] fixed password change (#3496) - [web] fixed saving of notification email for calendar changes (#3522) + - [web] fixed ACL editor for authenticated users in Mail module - [eas] allow EAS attachments get on 2nd-level mailboxes (#3505) - [eas] fix EAS bday shift (#3518) diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index bd9e6aeb4..fc101d726 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -135,15 +135,15 @@ } // Add the 'Any authenticated' user - if ([self canSubscribeUsers]) - { + if (defaultUserID) + { userData = [NSDictionary dictionaryWithObjectsAndKeys: - @"", @"uid", - [self labelForKey: @"Any Authenticated User"], @"cn", + defaultUserID, @"uid", + [self labelForKey: @"Any Authenticated User"], @"cn", @"public-user", @"userClass", nil]; - [users setObject: userData forKey: @""]; - } + [users setObject: userData forKey: defaultUserID]; + } if ([self canSubscribeUsers] && [self isPublicAccessEnabled]) { diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index 082d234f1..e03b0bf41 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -97,8 +97,12 @@ + + +
{{acl.confirmation.message}}
+
- {{acl.confirmation.message}} diff --git a/UI/WebServerResources/js/Common/AclController.js b/UI/WebServerResources/js/Common/AclController.js index 77e5c1370..0d2e1632c 100644 --- a/UI/WebServerResources/js/Common/AclController.js +++ b/UI/WebServerResources/js/Common/AclController.js @@ -44,7 +44,7 @@ } function confirmChange(user) { - var confirmation = user.$confirmRights(); + var confirmation = user.$confirmRights(vm.folder); if (confirmation) { vm.confirmation.showing = true; vm.confirmation.message = confirmation; diff --git a/UI/WebServerResources/js/Common/User.service.js b/UI/WebServerResources/js/Common/User.service.js index 1bb8d596a..43366df24 100644 --- a/UI/WebServerResources/js/Common/User.service.js +++ b/UI/WebServerResources/js/Common/User.service.js @@ -195,7 +195,7 @@ * @desc Check if a confirmation is required before giving some rights. * @return the confirmation message or false if no confirmation is required */ - User.prototype.$confirmRights = function() { + User.prototype.$confirmRights = function(folder) { var confirmation = false; if (this.$confirmation) { @@ -205,10 +205,18 @@ if (_.some(_.values(this.rights))) { if (this.uid == 'anonymous') { - confirmation = l('Potentially anyone on the Internet will be able to access your folder, even if they do not have an account on this system. Is this information suitable for the public Internet?'); + if (folder.constructor.name == 'AddressBook') + confirmation = l('Potentially anyone on the Internet will be able to access your address book "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?', folder.name); + else if (folder.constructor.name == 'Calendar') + confirmation = l('Potentially anyone on the Internet will be able to access your calendar "%{0}", even if they do not have an account on this system. Is this information suitable for the public Internet?', folder.name); } - else if (this.uid == '') { - confirmation = l('Any user with an account on this system will be able to access your folder. Are you certain you trust them all?'); + else if (this.uid == 'anyone' || this.uid == '') { + if (folder.constructor.name == 'AddressBook') + confirmation = l('Any user with an account on this system will be able to access your address book "%{0}". Are you certain you trust them all?', folder.name); + else if (folder.constructor.name == 'Calendar') + confirmation = l('Any user with an account on this system will be able to access your calendar "%{0}". Are you certain you trust them all?', folder.name); + else if (folder.constructor.name == 'Mailbox') + confirmation = l('Any user with an account on this system will be able to access your mailbox "%{0}". Are you certain you trust them all?', folder.name); } }