aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-15 16:28:42 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-15 16:28:42 +1300
commit9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11 (patch)
tree206d945cc152c8c9e945a7ee62c40d48701b06d2 /src/org/traccar/web
parent6ce1f7d481aec69107ef34924bda57fafbce67ed (diff)
downloadtrackermap-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.tar.gz
trackermap-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.tar.bz2
trackermap-server-9d159c880ab0fdb3f6f632dcb80577c6c2fb2f11.zip
Load and select user device list
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/DeviceServlet.java10
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)));
}
}