aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-02 01:58:06 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-02 01:58:06 +1300
commit8949b8275c730a008cd4dd677f03630f4111aba9 (patch)
treea88712494f829dd743880f9be97364d541199f35 /src/org/traccar
parent7adac25c304b046ebfc59b1197663625e862cc81 (diff)
downloadtraccar-server-8949b8275c730a008cd4dd677f03630f4111aba9.tar.gz
traccar-server-8949b8275c730a008cd4dd677f03630f4111aba9.tar.bz2
traccar-server-8949b8275c730a008cd4dd677f03630f4111aba9.zip
Allow remote access to web console
Diffstat (limited to 'src/org/traccar')
-rw-r--r--src/org/traccar/web/ConsoleServlet.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/web/ConsoleServlet.java b/src/org/traccar/web/ConsoleServlet.java
index b219eaba4..c1ab7c468 100644
--- a/src/org/traccar/web/ConsoleServlet.java
+++ b/src/org/traccar/web/ConsoleServlet.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -40,10 +40,16 @@ public class ConsoleServlet extends WebServlet {
+ Context.getConfig().getString("database.url") + "|"
+ Context.getConfig().getString("database.user"));
- Method method = org.h2.server.web.WebServer.class.getDeclaredMethod("updateSetting", ConnectionInfo.class);
+ Method method;
+
+ method = org.h2.server.web.WebServer.class.getDeclaredMethod("updateSetting", ConnectionInfo.class);
method.setAccessible(true);
method.invoke(server, connectionInfo);
+ method = org.h2.server.web.WebServer.class.getDeclaredMethod("setAllowOthers", boolean.class);
+ method.setAccessible(true);
+ method.invoke(server, true);
+
} catch (NoSuchFieldException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
Log.warning(e);
}