From 9cc7ba4e9a1dfceba1b88e32a35915f513b3a688 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 27 Nov 2017 17:20:35 +0500 Subject: - Fix local login if ldap enabled - Do not allow user edit own "Limit Command" permission --- src/org/traccar/database/DataManager.java | 2 +- src/org/traccar/database/PermissionsManager.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/org/traccar') diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index abc424ff9..f813426d3 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -307,7 +307,7 @@ public class DataManager { .executeQuerySingle(User.class); LdapProvider ldapProvider = Context.getLdapProvider(); if (user != null) { - if (ldapProvider != null && ldapProvider.login(user.getLogin(), password) + if (ldapProvider != null && user.getLogin() != null && ldapProvider.login(user.getLogin(), password) || !forceLdap && user.isPasswordValid(password)) { return user; } diff --git a/src/org/traccar/database/PermissionsManager.java b/src/org/traccar/database/PermissionsManager.java index 07b60ba58..0e9097d25 100644 --- a/src/org/traccar/database/PermissionsManager.java +++ b/src/org/traccar/database/PermissionsManager.java @@ -255,7 +255,8 @@ public class PermissionsManager { } if (before.getReadonly() != after.getReadonly() || before.getDeviceReadonly() != after.getDeviceReadonly() - || before.getDisabled() != after.getDisabled()) { + || before.getDisabled() != after.getDisabled() + || before.getLimitCommands() != after.getLimitCommands()) { if (userId == after.getId()) { checkAdmin(userId); } -- cgit v1.2.3