diff --git a/src/com/serotonin/mango/web/dwr/MiscDwr.java b/src/com/serotonin/mango/web/dwr/MiscDwr.java index 60324a88c3..31ea7a737b 100644 --- a/src/com/serotonin/mango/web/dwr/MiscDwr.java +++ b/src/com/serotonin/mango/web/dwr/MiscDwr.java @@ -25,7 +25,6 @@ import java.io.StringWriter; import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.ResourceBundle; @@ -253,6 +252,7 @@ public void setLocale(String locale) { public void setHomeUrl(String url) { + Permissions.ensureValidUser(); // Remove the scheme, domain, and context if there. HttpServletRequest request = WebContextFactory.get() .getHttpServletRequest(); @@ -276,6 +276,10 @@ public void setHomeUrl(String url) { url = url.substring(1); // Save the result + User user = Common.getUser(); + user.setHomeUrl(url); + UserService userService = new UserService(); + userService.saveHomeUrl(user.getId(), url); new UserDao().saveHomeUrl(Common.getUser().getId(), url); }