74559e91 by Andreyev Oleg

Lower case user login id when looking for UserLogin (Ref. #4079)

1 parent 50cfb506
......@@ -189,21 +189,23 @@ public class DirectControlServlet extends HttpServlet {
)
);
if (authTokenEntity != null &&
authTokenEntity.get("userLoginId") != null) {
GenericValue userLogin = EntityUtil.getFirst(
delegator.findList("UserLogin",
EntityCondition.makeCondition("userLoginId",
EntityOperator.EQUALS,
authTokenEntity.get("userLoginId")),
null, null, null, true));
if (userLogin != null) {
context.put("userLogin", userLogin);
}
if (authTokenEntity != null) {
String userLoginId = authTokenEntity.getString("userLoginId");
if (UtilValidate.isNotEmpty(userLoginId)) {
GenericValue userLogin = EntityUtil.getFirst(
delegator.findList("UserLogin",
EntityCondition.makeCondition("userLoginId",
EntityOperator.EQUALS,
userLoginId.toLowerCase()),
null, null, null, true));
if (userLogin != null) {
context.put("userLogin", userLogin);
}
// prolong the session
if (UtilValidate.isNotEmpty(checkSessionService)) {
dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("authSessionId", authToken, "userLogin", userLogin));
// prolong the session
if (UtilValidate.isNotEmpty(checkSessionService)) {
dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("authSessionId", authToken, "userLogin", userLogin));
}
}
}
}
......