From e289b428f57870a7ffe34a58ad38ae761353b763 Mon Sep 17 00:00:00 2001 From: Jens Pelzetter Date: Tue, 12 Jan 2021 18:55:21 +0100 Subject: [PATCH] Removed usage of MvcContext#uri Former-commit-id: d4b27e04c9d75c2aa535f45fa77ce34067a054ee --- .../usersgroupsroles/UsersController.java | 44 ++++++------------- 1 file changed, 13 insertions(+), 31 deletions(-) diff --git a/ccm-core/src/main/java/org/libreccm/ui/admin/usersgroupsroles/UsersController.java b/ccm-core/src/main/java/org/libreccm/ui/admin/usersgroupsroles/UsersController.java index 923db04e4..479f1005c 100644 --- a/ccm-core/src/main/java/org/libreccm/ui/admin/usersgroupsroles/UsersController.java +++ b/ccm-core/src/main/java/org/libreccm/ui/admin/usersgroupsroles/UsersController.java @@ -48,9 +48,9 @@ import javax.ws.rs.PathParam; import javax.ws.rs.QueryParam; /** - * Controller for the user details view and the {@code GET} requests to the - * user edit form. - * + * Controller for the user details view and the {@code GET} requests to the user + * edit form. + * * @author Jens Pelzetter */ @RequestScoped @@ -223,10 +223,7 @@ public class UsersController { final User user = result.get(); user.setBanned(true); userRepository.save(user); - return String.format( - //"redirect:%s", mvc.uri("UsersController#getUsers") - "redirect:users-groups-roles/users" - ); + return "redirect:users-groups-roles/users"; } else { userDetailsModel.addMessage( new Message( @@ -326,14 +323,9 @@ public class UsersController { ) { if (!confirmed) { return String.format( - "redirect:%s", - mvc.uri( - String.format( - "UsersController#getUserDetails", - "{ userIdentifier: %s}", - userIdentifierParam - ) - ) + "redirect:%s/users-groups-roles/users/%s", + mvc.getBasePath(), + userIdentifierParam ); } @@ -361,27 +353,17 @@ public class UsersController { final User user = result.get(); if (user.getEmailAddresses().size() <= emailId) { return String.format( - "redirect:%s", - mvc.uri( - String.format( - "UsersController#getUserDetails", - "{ userIdentifier: %s}", - userIdentifierParam - ) - ) + "redirect:%s/users-groups-roles/users/%s", + mvc.getBasePath(), + userIdentifierParam ); } user.getEmailAddresses().remove(emailId); userRepository.save(user); return String.format( - "redirect:%s", - mvc.uri( - String.format( - "UsersController#getUserDetails", - "{ userIdentifier: %s}", - userIdentifierParam - ) - ) + "redirect:%s/users-groups-roles/users/%s", + mvc.getBasePath(), + userIdentifierParam ); } else { userDetailsModel.addMessage(