74559e91 by Andreyev Oleg

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

1 parent 50cfb506
...@@ -189,13 +189,14 @@ public class DirectControlServlet extends HttpServlet { ...@@ -189,13 +189,14 @@ 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 if (UtilValidate.isNotEmpty(userLoginId)) {
194 GenericValue userLogin = EntityUtil.getFirst( 195 GenericValue userLogin = EntityUtil.getFirst(
195 delegator.findList("UserLogin", 196 delegator.findList("UserLogin",
196 EntityCondition.makeCondition("userLoginId", 197 EntityCondition.makeCondition("userLoginId",
197 EntityOperator.EQUALS, 198 EntityOperator.EQUALS,
198 authTokenEntity.get("userLoginId")), 199 userLoginId.toLowerCase()),
199 null, null, null, true)); 200 null, null, null, true));
200 if (userLogin != null) { 201 if (userLogin != null) {
201 context.put("userLogin", userLogin); 202 context.put("userLogin", userLogin);
...@@ -207,6 +208,7 @@ public class DirectControlServlet extends HttpServlet { ...@@ -207,6 +208,7 @@ public class DirectControlServlet extends HttpServlet {
207 } 208 }
208 } 209 }
209 } 210 }
211 }
210 212
211 Debug.logInfo("USERLOGIN " + context.get("userLogin") + " AUTHTOKEN " + authToken, module); 213 Debug.logInfo("USERLOGIN " + context.get("userLogin") + " AUTHTOKEN " + authToken, module);
212 214
......