diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-15 16:28:42 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-15 16:28:42 +1300 |
commit | 9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11 (patch) | |
tree | 206d945cc152c8c9e945a7ee62c40d48701b06d2 /src | |
parent | 6ce1f7d481aec69107ef34924bda57fafbce67ed (diff) | |
download | traccar-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.tar.gz traccar-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.tar.bz2 traccar-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.zip |
Load and select user device list
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/web/DeviceServlet.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/org/traccar/web/DeviceServlet.java b/src/org/traccar/web/DeviceServlet.java index cbbb41b9a..1ae94c1d0 100644 --- a/src/org/traccar/web/DeviceServlet.java +++ b/src/org/traccar/web/DeviceServlet.java @@ -50,8 +50,16 @@ public class DeviceServlet extends BaseServlet { sendResponse(resp.getWriter(), JsonConverter.arrayToJson( Context.getDataManager().getAllDevices())); } else { + long userId; + String userIdParam = req.getParameter("userId"); + if (userIdParam != null) { + userId = Long.parseLong(userIdParam); + } else { + userId = getUserId(req); + } + Context.getPermissionsManager().checkUser(getUserId(req), userId); sendResponse(resp.getWriter(), JsonConverter.arrayToJson( - Context.getDataManager().getDevices(getUserId(req)))); + Context.getDataManager().getDevices(userId))); } } |