Skip to content

Commit 43bcd32

Browse files
mgaffigantonygermano
authored andcommitted
Allow users to login with case-sensitive usernames if pre-existing
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
1 parent dc038da commit 43bcd32

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎server/src/com/mirth/connect/server/controllers/DefaultUserController.java‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,16 @@ public User getUser(Integer userId, String userName) throws ControllerException
103103
Useruser = newUser();
104104
user.setId(userId);
105105
user.setUsername(userName);
106-
returnSqlConfig.getInstance().getReadOnlySqlSessionManager().selectOne("User.getUser", user);
106+
List<User> list = SqlConfig.getInstance().getReadOnlySqlSessionManager().selectList("User.getUser", user);
107+
// If we have multiple results, we want to prefer the case sensitive match
108+
if (userName != null) {
109+
for (Useru : list) {
110+
if (userName.equals(u.getUsername())) {
111+
returnu;
112+
}
113+
}
114+
}
115+
returnlist.isEmpty() ? null : list.get(0);
107116
} catch (PersistenceExceptione) {
108117
thrownewControllerException(e);
109118
} finally {

0 commit comments

Comments
 (0)