Skip to content

Commit e23926e

Browse files
committed
LUI-83: Correcting the Variable Naming
1 parent b2edebf commit e23926e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

omod/src/main/java/org/openmrs/web/servlet/LoginServlet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,15 @@ public class LoginServlet extends HttpServlet {
7272
@Override
7373
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
7474
HttpSession httpSession = request.getSession();
75-
Integer loginAttemptsByUser;
75+
Integer loginAttemptsByUserName;
7676
String ipAddress = request.getRemoteAddr();
7777
Integer loginAttempts = loginAttemptsByIP.get(ipAddress);
7878
if (loginAttempts == null) {
7979
loginAttempts = 1;
8080
}
8181

8282
loginAttempts++;
83-
loginAttemptsByUser = loginAttempts - 1;
83+
loginAttemptsByUserName = loginAttempts - 1;
8484
boolean lockedOut = false;
8585
// look up the allowed # of attempts per IP
8686
Integer allowedLockoutAttempts = 100;
@@ -186,12 +186,12 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
186186
String maximumAttempts = Context.getAdministrationService().getGlobalProperty(GP_MAXIMUM_ALLOWED_LOGINS, "7");
187187
Integer maximumAlowedAttempts = Integer.valueOf(maximumAttempts);
188188

189-
if (loginAttemptsByUser <= maximumAlowedAttempts) {
189+
if (loginAttemptsByUserName <= maximumAlowedAttempts) {
190190
httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "auth.password.invalid");
191191

192192
}
193193

194-
if (loginAttemptsByUser > maximumAlowedAttempts) {
194+
if (loginAttemptsByUserName > maximumAlowedAttempts) {
195195
httpSession.setAttribute(WebConstants.OPENMRS_ERROR_ATTR, "legacyui.lockedOutMessage");
196196
}
197197
}

omod/src/test/java/org/openmrs/web/servlet/LoginServletTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public void shouldLockUserOutAfterFiveFailedLoginAttempts() throws Exception {
9797
loginServlet.service(request, response);
9898
}
9999

100-
// now attempting to log in the fifthth time should fail
100+
// now attempting to log in the fifth time should fail
101101
MockHttpServletRequest request = new MockHttpServletRequest("POST", "/loginServlet");
102102
request.setContextPath("/somecontextpath");
103103
MockHttpServletResponse response = new MockHttpServletResponse();

0 commit comments

Comments
 (0)