From 50adfa005368118ed5127599dcd9cc5974b30cd3 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Fri, 10 Jan 2014 00:21:21 -0300 Subject: [PATCH] Revert "Bug WISE-16 fixed. Backed completed." This reverts commit 9a77ff3bb86ff55ac603a02399d7435fe821dae9. --- .../wisemapping/rest/AccountController.java | 23 +------------------ .../com/wisemapping/rest/AdminController.java | 9 +------- .../wisemapping/service/UserServiceImpl.java | 13 +++-------- .../src/main/webapp/jsp/accountSettings.jsp | 23 ------------------- 4 files changed, 5 insertions(+), 63 deletions(-) diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java index 6084fafb..8a5bd969 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AccountController.java @@ -18,9 +18,7 @@ package com.wisemapping.rest; -import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.mail.NotificationService; -import com.wisemapping.model.Collaboration; import com.wisemapping.model.Mindmap; import com.wisemapping.model.User; import com.wisemapping.rest.model.RestLogItem; @@ -33,13 +31,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.http.HttpStatus; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletRequest; -import java.util.List; @Controller public class AccountController extends BaseController { @@ -106,21 +100,6 @@ public class AccountController extends BaseController { userService.updateUser(user); } - @RequestMapping(method = RequestMethod.DELETE, value = "account", consumes = {"text/plain"}) - @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void deleleteUser() throws WiseMappingException - - { - final User user = Utils.getUser(true); - final List collaborations = mindmapService.findCollaborations(user); - for (Collaboration collaboration : collaborations) { - final Mindmap mindmap = collaboration.getMindMap(); - mindmapService.removeMindmap(mindmap,user); - } - userService.deleteUser(user); - } - - @RequestMapping(method = RequestMethod.POST, value = "logger/editor", consumes = {"application/xml", "application/json"}, produces = {"application/json", "text/html", "application/xml"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) public void logError(@RequestBody RestLogItem item, @NotNull HttpServletRequest request) { diff --git a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java index c6688255..8cbdd537 100644 --- a/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java +++ b/wise-webapp/src/main/java/com/wisemapping/rest/AdminController.java @@ -117,18 +117,11 @@ public class AdminController extends BaseController { @RequestMapping(method = RequestMethod.DELETE, value = "admin/users/{id}", consumes = {"text/plain"}) @ResponseStatus(value = HttpStatus.NO_CONTENT) - public void deleteUserByEmail(@PathVariable long id) throws WiseMappingException { + public void getUserByEmail(@PathVariable long id) throws WiseMappingException { final User user = userService.getUserBy(id); if (user == null) { throw new IllegalArgumentException("User '" + id + "' could not be found"); } - - final List collaborations = mindmapService.findCollaborations(user); - for (Collaboration collaboration : collaborations) { - final Mindmap mindmap = collaboration.getMindMap(); - mindmapService.removeMindmap(mindmap,user); - } - userService.deleteUser(user); } diff --git a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java index 6364d3a7..2842f6f8 100755 --- a/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java +++ b/wise-webapp/src/main/java/com/wisemapping/service/UserServiceImpl.java @@ -21,11 +21,7 @@ package com.wisemapping.service; import com.wisemapping.dao.UserManager; import com.wisemapping.exceptions.WiseMappingException; import com.wisemapping.mail.NotificationService; -import com.wisemapping.model.AccessAuditory; -import com.wisemapping.model.AuthenticationType; -import com.wisemapping.model.Collaborator; -import com.wisemapping.model.Mindmap; -import com.wisemapping.model.User; +import com.wisemapping.model.*; import org.apache.velocity.app.VelocityEngine; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -33,11 +29,8 @@ import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.ui.velocity.VelocityEngineUtils; -import java.util.Calendar; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.UUID; +import java.io.IOException; +import java.util.*; public class UserServiceImpl implements UserService { diff --git a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp index 268caa07..5c1bf789 100755 --- a/wise-webapp/src/main/webapp/jsp/accountSettings.jsp +++ b/wise-webapp/src/main/webapp/jsp/accountSettings.jsp @@ -88,18 +88,6 @@ -
-
-
-
-
- - - "/> -
-
-
@@ -107,7 +95,6 @@ $('#changePasswordMsg').hide(); $('#changeInfoMsg').hide(); $('#languageMsg').hide(); - $('#deleteAccountMsg').hide(); function postChange(url, postBody, msgContainerId, successMsg) { // Change success message ... @@ -157,14 +144,4 @@ postChange("c/restful/account/locale", locale, 'languageMsg', ""); event.preventDefault(); }); - - $('#deleteAccountForm').submit(function (event) { - - var locale = $('#deleteAccountForm option:selected').val(); - - postChange("c/restful/account/locale", locale, 'languageMsg', ""); - event.preventDefault(); - }); - -