Index: lams_central/conf/language/lams/ApplicationResources.properties =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources.properties,v diff -u -r1.33 -r1.34 --- lams_central/conf/language/lams/ApplicationResources.properties 21 May 2008 08:46:50 -0000 1.33 +++ lams_central/conf/language/lams/ApplicationResources.properties 5 Jun 2008 01:46:52 -0000 1.34 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_central/conf/language/lams/ApplicationResources_en_AU.properties,v diff -u -r1.30 -r1.31 --- lams_central/conf/language/lams/ApplicationResources_en_AU.properties 21 May 2008 08:46:51 -0000 1.30 +++ lams_central/conf/language/lams/ApplicationResources_en_AU.properties 5 Jun 2008 01:46:52 -0000 1.31 @@ -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 =================================================================== RCS file: /usr/local/cvsroot/lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java,v diff -u -r1.5 -r1.6 --- lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java 16 Apr 2008 06:33:09 -0000 1.5 +++ lams_central/src/java/org/lamsfoundation/lams/web/ForgotPasswordServlet.java 5 Jun 2008 01:46:52 -0000 1.6 @@ -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 +