diff options
author | Hans van den Elsen <hans.elsen@esds.nl> | 2016-02-12 13:20:08 +0100 |
---|---|---|
committer | Hans van den Elsen <hans.elsen@esds.nl> | 2016-02-12 13:20:08 +0100 |
commit | b0d7abf2d91429eac8e4ae8d5b96cdf3853dae2e (patch) | |
tree | bd97170ca02244c6ef85f06cefd547793c669572 /src/org/traccar/web/CommandServlet.java | |
parent | b7caadd9aa3da5487ca9bd64ffc6b2486f619c60 (diff) | |
download | trackermap-server-b0d7abf2d91429eac8e4ae8d5b96cdf3853dae2e.tar.gz trackermap-server-b0d7abf2d91429eac8e4ae8d5b96cdf3853dae2e.tar.bz2 trackermap-server-b0d7abf2d91429eac8e4ae8d5b96cdf3853dae2e.zip |
Reverted customizations for own API
Diffstat (limited to 'src/org/traccar/web/CommandServlet.java')
-rw-r--r-- | src/org/traccar/web/CommandServlet.java | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/org/traccar/web/CommandServlet.java b/src/org/traccar/web/CommandServlet.java index 7febb7f42..ff8c85542 100644 --- a/src/org/traccar/web/CommandServlet.java +++ b/src/org/traccar/web/CommandServlet.java @@ -22,7 +22,6 @@ import javax.servlet.http.HttpServletResponse; import org.traccar.Context; import org.traccar.database.ActiveDevice; import org.traccar.model.Command; -import org.traccar.model.User; public class CommandServlet extends BaseServlet { @@ -60,13 +59,8 @@ public class CommandServlet extends BaseServlet { JsonObject json = Json.createReader(req.getReader()).readObject(); long deviceId = json.getJsonNumber("deviceId").longValue(); String command = json.getString("command"); - String username = json.getString("email"); - String password = json.getString("password"); - boolean success = false; - if(username.equals("admin") && password.equals("VGY&7ujm")) { - getActiveDevice(deviceId).write(command); - success = true; - } - sendResponse(resp.getWriter(), success); + Context.getPermissionsManager().checkDevice(getUserId(req), deviceId); + getActiveDevice(deviceId).write(command); + sendResponse(resp.getWriter(), true); } } |