aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/www/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/www/controllers')
-rw-r--r--src/main/java/com/juick/server/www/controllers/AnythingFilter.java2
-rw-r--r--src/main/java/com/juick/server/www/controllers/Settings.java12
2 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/com/juick/server/www/controllers/AnythingFilter.java b/src/main/java/com/juick/server/www/controllers/AnythingFilter.java
index cdbeafc0..57b298eb 100644
--- a/src/main/java/com/juick/server/www/controllers/AnythingFilter.java
+++ b/src/main/java/com/juick/server/www/controllers/AnythingFilter.java
@@ -60,7 +60,7 @@ public class AnythingFilter extends OncePerRequestFilter {
} else {
com.juick.User user = userService.getUserByName(anything);
if (!user.isAnonymous()) {
- ((HttpServletResponse) servletResponse).sendRedirect("/" + user.getName() + "/?before=" + before);
+ servletResponse.sendRedirect("/" + user.getName() + "/?before=" + before);
} else {
filterChain.doFilter(servletRequest, servletResponse);
}
diff --git a/src/main/java/com/juick/server/www/controllers/Settings.java b/src/main/java/com/juick/server/www/controllers/Settings.java
index fc84b410..d5a21d09 100644
--- a/src/main/java/com/juick/server/www/controllers/Settings.java
+++ b/src/main/java/com/juick/server/www/controllers/Settings.java
@@ -18,7 +18,6 @@ package com.juick.server.www.controllers;
import com.juick.User;
import com.juick.model.NotifyOpts;
-import com.juick.model.UserInfo;
import com.juick.server.util.HttpBadRequestException;
import com.juick.server.util.HttpUtils;
import com.juick.server.util.UserUtils;
@@ -156,16 +155,15 @@ public class Settings {
}
break;
case "about":
- UserInfo info = new UserInfo();
- info.setFullName(request.getParameter("fullname"));
- info.setCountry(request.getParameter("country"));
- info.setUrl(request.getParameter("url"));
- info.setDescription(request.getParameter("descr"));
+ visitor.setFullName(request.getParameter("fullname"));
+ visitor.setCountry(request.getParameter("country"));
+ visitor.setUrl(request.getParameter("url"));
+ visitor.setDescription(request.getParameter("descr"));
String avatarTmpPath = HttpUtils.receiveMultiPartFile(avatar, tmpDir).getHost();
if (StringUtils.isNotEmpty(avatarTmpPath)) {
imagesService.saveAvatar(avatarTmpPath, visitor.getUid());
}
- if (userService.updateUserInfo(visitor, info)) {
+ if (userService.updateUserInfo(visitor)) {
result = String.format("<p>Your info is updated.</p><p><a href='/%s/'>Back to blog</a>.</p>", visitor.getName());
}
break;