aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorHans van den Elsen <hans.elsen@esds.nl>2016-02-09 21:49:38 +0100
committerHans van den Elsen <hans.elsen@esds.nl>2016-02-09 21:49:38 +0100
commit2db1eb02128baf5362b84b49ec404d905856ecca (patch)
treefff149b9863379b87190571b5683dcf5f08d70c3 /src/org/traccar
parent7883c78aef55c73cbfb4213f7720f3e450f89c75 (diff)
downloadtrackermap-server-2db1eb02128baf5362b84b49ec404d905856ecca.tar.gz
trackermap-server-2db1eb02128baf5362b84b49ec404d905856ecca.tar.bz2
trackermap-server-2db1eb02128baf5362b84b49ec404d905856ecca.zip
Alter API to send raw messages
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/web/CommandServlet.java12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/org/traccar/web/CommandServlet.java b/src/org/traccar/web/CommandServlet.java
index ff8c85542..7febb7f42 100644
--- a/src/org/traccar/web/CommandServlet.java
+++ b/src/org/traccar/web/CommandServlet.java
@@ -22,6 +22,7 @@ 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 {
@@ -59,8 +60,13 @@ public class CommandServlet extends BaseServlet {
JsonObject json = Json.createReader(req.getReader()).readObject();
long deviceId = json.getJsonNumber("deviceId").longValue();
String command = json.getString("command");
- Context.getPermissionsManager().checkDevice(getUserId(req), deviceId);
- getActiveDevice(deviceId).write(command);
- sendResponse(resp.getWriter(), true);
+ 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);
}
}