Lower case user login id when looking for UserLogin (Ref. #4079)
Showing
1 changed file
with
16 additions
and
14 deletions
... | @@ -189,21 +189,23 @@ public class DirectControlServlet extends HttpServlet { | ... | @@ -189,21 +189,23 @@ public class DirectControlServlet extends HttpServlet { |
189 | ) | 189 | ) |
190 | ); | 190 | ); |
191 | 191 | ||
192 | if (authTokenEntity != null && | 192 | if (authTokenEntity != null) { |
193 | authTokenEntity.get("userLoginId") != null) { | 193 | String userLoginId = authTokenEntity.getString("userLoginId"); |
194 | GenericValue userLogin = EntityUtil.getFirst( | 194 | if (UtilValidate.isNotEmpty(userLoginId)) { |
195 | delegator.findList("UserLogin", | 195 | GenericValue userLogin = EntityUtil.getFirst( |
196 | EntityCondition.makeCondition("userLoginId", | 196 | delegator.findList("UserLogin", |
197 | EntityOperator.EQUALS, | 197 | EntityCondition.makeCondition("userLoginId", |
198 | authTokenEntity.get("userLoginId")), | 198 | EntityOperator.EQUALS, |
199 | null, null, null, true)); | 199 | userLoginId.toLowerCase()), |
200 | if (userLogin != null) { | 200 | null, null, null, true)); |
201 | context.put("userLogin", userLogin); | 201 | if (userLogin != null) { |
202 | } | 202 | context.put("userLogin", userLogin); |
203 | } | ||
203 | 204 | ||
204 | // prolong the session | 205 | // prolong the session |
205 | if (UtilValidate.isNotEmpty(checkSessionService)) { | 206 | if (UtilValidate.isNotEmpty(checkSessionService)) { |
206 | dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("authSessionId", authToken, "userLogin", userLogin)); | 207 | dispatcher.runSync(checkSessionService, UtilMisc.<String, Object>toMap("authSessionId", authToken, "userLogin", userLogin)); |
208 | } | ||
207 | } | 209 | } |
208 | } | 210 | } |
209 | } | 211 | } | ... | ... |
-
Please register or sign in to post a comment