From 2f9bb4d460698671b1ae3b7e0f3065541196fa82 Mon Sep 17 00:00:00 2001 From: j2blake Date: Tue, 13 Sep 2011 19:33:41 +0000 Subject: [PATCH] revise the changes on r8934, which affected the default message for bogus requests, instead of just requests to set passwords on non-existent accounts. --- .../accounts/user/UserAccountsPasswordBasePage.java | 8 +++++--- .../accounts/user/UserAccountsUserController.java | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsPasswordBasePage.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsPasswordBasePage.java index 73b2b09a6..4c814f4be 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsPasswordBasePage.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsPasswordBasePage.java @@ -24,6 +24,8 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { private static final Log log = LogFactory .getLog(UserAccountsPasswordBasePage.class); + public static final String BOGUS_MESSAGE_NO_SUCH_ACCOUNT = "The account you are trying to set a password on is no longer available. Please contact your system administrator if you think this is an error."; + private static final String PARAMETER_SUBMIT = "submit"; private static final String PARAMETER_USER = "user"; private static final String PARAMETER_KEY = "key"; @@ -76,7 +78,7 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { if (userAccount == null) { log.warn("Password request for '" + userEmail + "' is bogus: no such user"); - bogusMessage = BOGUS_STANDARD_MESSAGE; + bogusMessage = BOGUS_MESSAGE_NO_SUCH_ACCOUNT; return; } @@ -98,7 +100,7 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { if (expirationDate.before(new Date())) { log.info("Password request for '" + userEmail + "' is bogus: expiration date has passed."); - bogusMessage = BOGUS_STANDARD_MESSAGE; + bogusMessage = passwordChangeNotPendingMessage(); return; } @@ -107,7 +109,7 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { log.warn("Password request for '" + userEmail + "' is bogus: key (" + key + ") doesn't match expected key (" + expectedKey + ")"); - bogusMessage = BOGUS_STANDARD_MESSAGE; + bogusMessage = passwordChangeNotPendingMessage(); return; } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsUserController.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsUserController.java index 1485a1a29..4437e35cb 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsUserController.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsUserController.java @@ -25,7 +25,7 @@ public class UserAccountsUserController extends FreemarkerHttpServlet { private static final Log log = LogFactory .getLog(UserAccountsUserController.class); - public static final String BOGUS_STANDARD_MESSAGE = "The account you are trying to set a password on is no longer available. Please contact your system administrator if you think this is an error."; + public static final String BOGUS_STANDARD_MESSAGE = "Request failed. Please contact your system administrator."; private static final String ACTION_CREATE_PASSWORD = "/createPassword"; private static final String ACTION_RESET_PASSWORD = "/resetPassword";