diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-05 19:18:58 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-05 19:18:58 +1200 |
commit | 61bd26d530710e74ef1c0dfd6920b9c1d27cfdd5 (patch) | |
tree | 92638aecdc7e10b0eb745954304798cce3f9ff3d /src/org/traccar/http | |
parent | c2afe93f1443181bc7bcce2df708a88c331b8800 (diff) | |
download | traccar-server-61bd26d530710e74ef1c0dfd6920b9c1d27cfdd5.tar.gz traccar-server-61bd26d530710e74ef1c0dfd6920b9c1d27cfdd5.tar.bz2 traccar-server-61bd26d530710e74ef1c0dfd6920b9c1d27cfdd5.zip |
Add user account dialog
Diffstat (limited to 'src/org/traccar/http')
-rw-r--r-- | src/org/traccar/http/MainServlet.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/http/MainServlet.java b/src/org/traccar/http/MainServlet.java index 18430f0c3..84ec25906 100644 --- a/src/org/traccar/http/MainServlet.java +++ b/src/org/traccar/http/MainServlet.java @@ -34,6 +34,8 @@ public class MainServlet extends BaseServlet { logout(req, resp); } else if (command.equals("/register")) { register(req, resp); + } else if (command.equals("/user/update")) { + update(req, resp); } else { return false; } @@ -70,5 +72,11 @@ public class MainServlet extends BaseServlet { Context.getDataManager().addUser(user); sendResponse(resp.getWriter(), true); } + + private void update(HttpServletRequest req, HttpServletResponse resp) throws Exception { + Context.getDataManager().updateUser(JsonConverter.objectFromJson( + req.getReader(), new User())); + sendResponse(resp.getWriter(), true); + } } |