diff options
author | Abyss777 <abyss@fox5.ru> | 2017-07-12 17:15:31 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-07-12 17:15:31 +0500 |
commit | 74471c1fbbb7e8a09a6958fa88930a2905b4a3eb (patch) | |
tree | 4c55cefc6ca61a3df7d9a66ac84ae8cd302bd29f /src/org/traccar/database/DriversManager.java | |
parent | c13dce2dd0227f58135c1066461304bbdc551554 (diff) | |
download | trackermap-server-74471c1fbbb7e8a09a6958fa88930a2905b4a3eb.tar.gz trackermap-server-74471c1fbbb7e8a09a6958fa88930a2905b4a3eb.tar.bz2 trackermap-server-74471c1fbbb7e8a09a6958fa88930a2905b4a3eb.zip |
Do not generate unathorized events if no one driver linked to device
Diffstat (limited to 'src/org/traccar/database/DriversManager.java')
-rw-r--r-- | src/org/traccar/database/DriversManager.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/database/DriversManager.java b/src/org/traccar/database/DriversManager.java index 1744936e3..cba2e14c1 100644 --- a/src/org/traccar/database/DriversManager.java +++ b/src/org/traccar/database/DriversManager.java @@ -214,7 +214,11 @@ public class DriversManager { public final boolean authorizeDriverByUniqueId(String driverUniqueId, long deviceId) { if (driversByUniqueId.containsKey(driverUniqueId)) { long chekingDriverId = getDriverByUniqueId(driverUniqueId).getId(); - for (long driverId : getAllDeviceDrivers(deviceId)) { + Set<Long> deviceDrivers = getAllDeviceDrivers(deviceId); + if (deviceDrivers.isEmpty()) { + return true; + } + for (long driverId : deviceDrivers) { if (chekingDriverId == driverId) { return true; } |