From 51cdee534cd9990d1de173814fe95c55dead4934 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 16 Jun 2022 08:24:48 -0700 Subject: Refactor login --- .../org/traccar/database/PermissionsManager.java | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/main/java/org/traccar/database/PermissionsManager.java') diff --git a/src/main/java/org/traccar/database/PermissionsManager.java b/src/main/java/org/traccar/database/PermissionsManager.java index f6fbd9489..4ac27c717 100644 --- a/src/main/java/org/traccar/database/PermissionsManager.java +++ b/src/main/java/org/traccar/database/PermissionsManager.java @@ -190,19 +190,6 @@ public class PermissionsManager { } } - public void checkUserEnabled(long userId) throws SecurityException { - User user = getUser(userId); - if (user == null) { - throw new SecurityException("Unknown account"); - } - if (user.getDisabled()) { - throw new SecurityException("Account is disabled"); - } - if (user.getExpirationTime() != null && System.currentTimeMillis() > user.getExpirationTime().getTime()) { - throw new SecurityException("Account has expired"); - } - } - public void refreshPermissions(Permission permission) { if (permission.getOwnerClass().equals(User.class)) { if (permission.getPropertyClass().equals(Device.class) @@ -212,13 +199,4 @@ public class PermissionsManager { } } - public User login(String email, String password) throws StorageException { - User user = dataManager.login(email, password); - if (user != null) { - checkUserEnabled(user.getId()); - return getUser(user.getId()); - } - return null; - } - } -- cgit v1.2.3