From 4e8d3ce900b664c2f50c21fccef932446f3fb03e Mon Sep 17 00:00:00 2001 From: Alexandre Cloutier Date: Wed, 8 Oct 2014 15:14:15 -0400 Subject: [PATCH] add dialog window for public and allusers access --- UI/WebServerResources/GNUmakefile | 4 +-- UI/WebServerResources/js/ContactsUI.js | 34 ++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/UI/WebServerResources/GNUmakefile b/UI/WebServerResources/GNUmakefile index 112e1fe6a..7ec9d633c 100644 --- a/UI/WebServerResources/GNUmakefile +++ b/UI/WebServerResources/GNUmakefile @@ -6,9 +6,9 @@ WEBSERVER_RESOURCE_DIRS = css fonts img js build-static-files: @if [ -d bower_components ]; then \ - bower update; \ + bower update --allow-root; \ else \ - bower install; \ + bower install --allow-root; \ fi ( cd bower_components/underscore/ && npm run-script build ) grunt build diff --git a/UI/WebServerResources/js/ContactsUI.js b/UI/WebServerResources/js/ContactsUI.js index ab954b10e..cb0d86fd0 100644 --- a/UI/WebServerResources/js/ContactsUI.js +++ b/UI/WebServerResources/js/ContactsUI.js @@ -197,9 +197,39 @@ }; $scope.saveModal = function() { if(!_.isEmpty(dirtyObjects)) { - $scope.AclUsers.saveUsersRights(dirtyObjects); + if(dirtyObjects["anonymous"]) + { + Dialog.confirm(l("Warning"), l("Any user with an account on this system will be able to access your folder. Are you certain you trust them all?")).then(function(res){ + if(res){ + $scope.AclUsers.saveUsersRights(dirtyObjects); + $modalInstance.close(); + }; + }) + } + else if (dirtyObjects[""]) { + Dialog.confirm(l("Warning"), 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?")).then(function(res){ + if(res){ + $scope.AclUsers.saveUsersRights(dirtyObjects); + $modalInstance.close(); + }; + }) + } + else { + $scope.AclUsers.saveUsersRights(dirtyObjects); + var usersToSubscribe = []; + angular.forEach(dirtyObjects, function(dirtyObject){ + if(dirtyObject.canSubscribeUser && dirtyObject.isSubscribed){ + usersToSubscribe.push(dirtyObject.uid); + } + }) + if(!_.isEmpty(usersToSubscribe)) + $scope.AclUsers.subscribeUsers(usersToSubscribe); + + $modalInstance.close(); + } } - $modalInstance.close(); + else + $scope.$aclEditorModal.remove(); }; $scope.removeUser = function() { if (!_.isEmpty($scope.userSelected)) {