aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-17 22:48:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-17 22:48:33 +1300
commitaf6c734879aa483efcc8150d5fdb704f40fb59cd (patch)
tree3d8e4c832f87954513b1dbd614f7a1f757a4fa99 /src/org/traccar/database
parent512b95fd6975005c6460ddad16714502510cb16e (diff)
downloadtrackermap-server-af6c734879aa483efcc8150d5fdb704f40fb59cd.tar.gz
trackermap-server-af6c734879aa483efcc8150d5fdb704f40fb59cd.tar.bz2
trackermap-server-af6c734879aa483efcc8150d5fdb704f40fb59cd.zip
Add user expiration and device limit
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r--src/org/traccar/database/PermissionsManager.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java
index b0ae504d0..e620d5334 100644
--- a/src/org/traccar/database/PermissionsManager.java
+++ b/src/org/traccar/database/PermissionsManager.java
@@ -217,11 +217,11 @@ public class PermissionsManager {
public User login(String email, String password) throws SQLException {
User user = dataManager.login(email, password);
- if (user != null && users.get(user.getId()) != null) {
+ if (user != null && !user.getDisabled() && (user.getExpirationTime() == null
+ || user.getExpirationTime().getTime() > System.currentTimeMillis())) {
return users.get(user.getId());
- } else {
- return null;
}
+ return null;
}
}