From 8949b8275c730a008cd4dd677f03630f4111aba9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 2 Nov 2016 01:58:06 +1300 Subject: Allow remote access to web console --- src/org/traccar/web/ConsoleServlet.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/web/ConsoleServlet.java') 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); } -- cgit v1.2.3