aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Context.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-09 08:45:18 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-09 13:35:17 +0500
commit17dc43290bb821c77eaaf196e4c6fef4d5c1a343 (patch)
tree3fa80a7297952701b95c022470209db207c04fc7 /src/org/traccar/Context.java
parent50503c7108e580e5bc00d6c67055de273f476911 (diff)
downloadtrackermap-server-17dc43290bb821c77eaaf196e4c6fef4d5c1a343.tar.gz
trackermap-server-17dc43290bb821c77eaaf196e4c6fef4d5c1a343.tar.bz2
trackermap-server-17dc43290bb821c77eaaf196e4c6fef4d5c1a343.zip
Added links to server in mail templates
Diffstat (limited to 'src/org/traccar/Context.java')
-rw-r--r--src/org/traccar/Context.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java
index ef515ad2f..62396d740 100644
--- a/src/org/traccar/Context.java
+++ b/src/org/traccar/Context.java
@@ -17,6 +17,7 @@ package org.traccar;
import com.ning.http.client.AsyncHttpClient;
+import java.net.InetAddress;
import java.util.Properties;
import org.apache.velocity.app.VelocityEngine;
@@ -256,6 +257,13 @@ public final class Context {
Context.getConfig().getString("mail.templatesPath", "templates/mail") + "/");
velocityProperties.setProperty("runtime.log.logsystem.class",
"org.apache.velocity.runtime.log.NullLogChute");
+
+ String address = config.getString("web.address", InetAddress.getLocalHost().getHostAddress());
+ String port = config.getString("web.port", "8082");
+ String webUrl = "http://" + address + ":" + port + "/";
+ webUrl = Context.getConfig().getString("web.url", webUrl);
+ velocityProperties.setProperty("web.url", webUrl);
+
velocityEngine = new VelocityEngine();
velocityEngine.init(velocityProperties);
}