diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-04 10:01:55 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-04 10:01:55 +1200 |
commit | 15bccd650ea2236ba2ca7296a9c76bfb51208d5a (patch) | |
tree | ee16f37f035303b9166cf54195f8f68de4e92861 /src/org/traccar/web | |
parent | 8effc28a59e132982eced64ee470132bfe5a38b9 (diff) | |
download | traccar-server-15bccd650ea2236ba2ca7296a9c76bfb51208d5a.tar.gz traccar-server-15bccd650ea2236ba2ca7296a9c76bfb51208d5a.tar.bz2 traccar-server-15bccd650ea2236ba2ca7296a9c76bfb51208d5a.zip |
Security check for adding device
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r-- | src/org/traccar/web/DeviceServlet.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/web/DeviceServlet.java b/src/org/traccar/web/DeviceServlet.java index 6b65efa8b..f091be1af 100644 --- a/src/org/traccar/web/DeviceServlet.java +++ b/src/org/traccar/web/DeviceServlet.java @@ -51,8 +51,9 @@ public class DeviceServlet extends BaseServlet { private void add(HttpServletRequest req, HttpServletResponse resp) throws Exception { Device device = JsonConverter.objectFromJson(req.getReader(), new Device()); + long userId = getUserId(req); Context.getDataManager().addDevice(device); - Context.getDataManager().linkDevice(getUserId(req), device.getId()); + Context.getDataManager().linkDevice(userId, device.getId()); Context.getPermissionsManager().refresh(); sendResponse(resp.getWriter(), JsonConverter.objectToJson(device)); } |