Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r31037d3d873f87b6c212f635ed7f6ed3f4216a7b -r567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99 --- lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 31037d3d873f87b6c212f635ed7f6ed3f4216a7b) +++ lams_central/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99) @@ -210,6 +210,7 @@ error.email.not.found =Unable to find a user that matches the given email. Please check your email address and try again. error.forgot.password.email =Please enter an email address. error.forgot.password.username =Please enter a username. +error.forgot.password.incorrect.key =The request key is incorrect or has already been used. Please click the "Forgot your Password" link again to make a new request. button.select.another.importfile =Select Another File To Import msg.import.success =Learning design and activities imported successfully. msg.export.success =Learning design and activities export successfully. Index: lams_central/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r31037d3d873f87b6c212f635ed7f6ed3f4216a7b -r567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 31037d3d873f87b6c212f635ed7f6ed3f4216a7b) +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99) @@ -210,9 +210,11 @@ error.email.not.found =Unable to find a user that matches the given email. Please check your email address and try again. error.forgot.password.email =Please enter an email address. error.forgot.password.username =Please enter a username. +error.forgot.password.incorrect.key =The request key is incorrect or has already been used. Please click the "Forgot your Password" link again to make a new request. button.select.another.importfile =Select Another File To Import msg.import.success =Learning design and activities imported successfully. msg.export.success =Learning design and activities export successfully. + #======= End labels: Exported 207 labels for en AU ===== Index: lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java =================================================================== diff -u -r666fb04f2c0a0fba205a3efb7c0fc64680aeefcc -r567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99 --- lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java (.../ForgotPasswordServlet.java) (revision 666fb04f2c0a0fba205a3efb7c0fc64680aeefcc) +++ lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java (.../ForgotPasswordServlet.java) (revision 567213ee8bd2114b9f5bf0fc51e9e1cbabef4b99) @@ -56,6 +56,7 @@ public static String EMAIL_NOT_FOUND = "error.email.not.found"; public static String MULTIPLE_EMAILS = "error.multiple.emails"; public static String EMAIL_FAILED = "error.email.not.sent"; + public static String REQUEST_KEY_NOT_FOUND = "error.forgot.password.incorrect.key"; private static int MILLISECONDS_IN_A_DAY = 86400000; @@ -269,6 +270,18 @@ IUserManagementService userService = (IUserManagementService) ctx.getBean("userManagementService"); ForgotPasswordRequest fp = userService.getForgotPasswordRequest(key); + + if (fp == null) + { + response.sendRedirect(Configuration.get("ServerURL") + "forgotPasswordProc.jsp?" + + STATE + + 0 + + LANGUAGE_KEY + + REQUEST_KEY_NOT_FOUND + ); + return; + } + long cutoffTime = fp.getRequestDate().getTime() + MILLISECONDS_IN_A_DAY; Date now = new Date(); long nowLong = now.getTime(); @@ -287,6 +300,8 @@ languageKey = this.PASSWORD_REQUEST_EXPIRED; } + userService.delete(fp); + response.sendRedirect(Configuration.get("ServerURL") + "forgotPasswordProc.jsp?" + STATE + success +