aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-10-19 18:35:28 +0500
committerAbyss777 <abyss@fox5.ru>2016-10-19 18:35:28 +0500
commit17f5a899a08b992507b574eeb4047b1f6bfa8629 (patch)
tree38044c918384b21e9533452d6a408f0935c96a1e /src/org/traccar/database
parentc613143105d9f7c898dd3fb236d683b76cf8a42c (diff)
downloadtraccar-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.tar.gz
traccar-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.tar.bz2
traccar-server-17f5a899a08b992507b574eeb4047b1f6bfa8629.zip
- Filter events on server side
- Use common path for templates - Filter events about geofences that user do not have access (minor security fix) - Removed unused function - Visual templates improvements
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/DataManager.java11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index 58d16d7f5..e98e1429c 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -20,7 +20,6 @@ import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.sql.SQLException;
-import java.util.Calendar;
import java.util.Collection;
import java.util.Date;
@@ -332,22 +331,14 @@ public class DataManager {
.executeUpdate());
}
- public Collection<Event> getEvents(long deviceId, String type, Date from, Date to) throws SQLException {
+ public Collection<Event> getEvents(long deviceId, Date from, Date to) throws SQLException {
return QueryBuilder.create(dataSource, getQuery("database.selectEvents"))
.setLong("deviceId", deviceId)
- .setString("type", type)
.setDate("from", from)
.setDate("to", to)
.executeQuery(Event.class);
}
- public Collection<Event> getLastEvents(long deviceId, String type, int interval) throws SQLException {
- Calendar calendar = Calendar.getInstance();
- calendar.add(Calendar.SECOND, -interval);
- Date from = calendar.getTime();
- return getEvents(deviceId, type, from, new Date());
- }
-
public Collection<Geofence> getGeofences() throws SQLException {
return QueryBuilder.create(dataSource, getQuery("database.selectGeofencesAll"))
.executeQuery(Geofence.class);