From c4d2acec7bf0ca3be93077ce1ef50d5b866cd831 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 12 Jun 2012 22:33:51 -0300 Subject: [PATCH] Fix several minor security bugs. --- .../rest/model/RestCollaboration.java | 2 +- .../service/MindmapServiceImpl.java | 16 +- .../src/main/webapp/jsp/mindmapShare.jsp | 275 ++++++++++-------- 3 files changed, 165 insertions(+), 128 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java index b5057e87..b9a9eab4 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/model/RestCollaboration.java @@ -24,7 +24,7 @@ public class RestCollaboration { public RestCollaboration(@NotNull Collaboration collaboration) { this.email = collaboration.getCollaborator().getEmail(); - this.role = collaboration.getRole().name(); + this.role = collaboration.getRole().getLabel(); } public RestCollaboration() { diff --git a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java index f8382cfe..90bab924 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/MindmapServiceImpl.java @@ -166,12 +166,16 @@ public class MindmapServiceImpl mindmap.getCollaborations().add(collaboration); mindmapManager.saveMindmap(mindmap); - // Sent collaboration email ... - final Map model = new HashMap(); - model.put("role", role); - model.put("map", mindmap); - model.put("message", "message"); - mailer.sendEmail(mailer.getSiteEmail(), email, "Collaboration", model, "newColaborator.vm"); + try { + // Sent collaboration email ... + final Map model = new HashMap(); + model.put("role", role); + model.put("map", mindmap); + model.put("message", "message"); + mailer.sendEmail(mailer.getSiteEmail(), email, "Collaboration", model, "newColaborator.vm"); + } catch (Exception e) { + e.printStackTrace(); + } } else if (collaboration.getRole() != role) { // If the relationship already exists and the role changed then only update the role diff --git a/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp b/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp index d315e3d1..7f604d4e 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapShare.jsp @@ -28,6 +28,11 @@
+ + + + +
@@ -51,19 +56,25 @@