From 8f1f084c5b0f57d460058fb65e1be8504260995b Mon Sep 17 00:00:00 2001 From: j2blake Date: Fri, 26 Apr 2013 23:58:50 -0400 Subject: [PATCH] Proof of concept - User accounts --- .../controller/AbstractPageHandler.java | 7 +- .../admin/UserAccountsAddPageStrategy.java | 2 +- .../accounts/admin/UserAccountsDeleter.java | 11 +- .../accounts/admin/UserAccountsEditPage.java | 7 +- .../user/UserAccountsCreatePasswordPage.java | 8 +- .../UserAccountsFirstTimeExternalPage.java | 9 +- ...AccountsFirstTimeExternalPageStrategy.java | 2 +- .../UserAccountsMyAccountPageStrategy.java | 2 +- .../user/UserAccountsPasswordBasePage.java | 8 +- .../user/UserAccountsResetPasswordPage.java | 9 +- .../user/UserAccountsUserController.java | 13 +- webapp/web/i18n/all.properties | 145 ++++++++++++++++++ .../web/i18n/files/accountCreatedEmail.html | 39 +++++ webapp/web/i18n/files/accountCreatedEmail.txt | 17 ++ .../accountCreatedExternalOnlyEmail.html | 22 +++ .../files/accountCreatedExternalOnlyEmail.txt | 9 ++ .../web/i18n/files/accountEmailChanged.html | 19 +++ webapp/web/i18n/files/accountEmailChanged.txt | 6 + .../i18n/files/accountFirstTimeExternal.html | 22 +++ .../i18n/files/accountFirstTimeExternal.txt | 8 + .../web/i18n/files/passwordCreatedEmail.html | 22 +++ .../web/i18n/files/passwordCreatedEmail.txt | 8 + .../i18n/files/passwordRequestPending.html | 34 ++++ .../web/i18n/files/passwordRequestPending.txt | 16 ++ .../web/i18n/files/passwordResetComplete.html | 22 +++ .../web/i18n/files/passwordResetComplete.txt | 8 + .../web/i18n/files/passwordResetPending.html | 34 ++++ .../web/i18n/files/passwordResetPending.txt | 16 ++ webapp/web/js/account/accountUtils.js | 2 +- .../userAccounts-acctCreatedEmail.ftl | 73 ++------- ...rAccounts-acctCreatedExternalOnlyEmail.ftl | 46 ++---- .../body/accounts/userAccounts-add.ftl | 89 ++++------- .../userAccounts-associateProfilePanel.ftl | 26 ++-- .../userAccounts-confirmEmailChangedEmail.ftl | 43 ++---- .../accounts/userAccounts-createPassword.ftl | 49 +++--- .../body/accounts/userAccounts-edit.ftl | 91 +++++------ .../userAccounts-firstTimeExternal.ftl | 54 +++---- .../userAccounts-firstTimeExternalEmail.ftl | 46 ++---- .../body/accounts/userAccounts-list.ftl | 86 +++++------ .../body/accounts/userAccounts-myAccount.ftl | 82 +++++----- .../accounts/userAccounts-myProxiesPanel.ftl | 18 ++- .../userAccounts-passwordCreatedEmail.ftl | 46 ++---- ...serAccounts-passwordResetCompleteEmail.ftl | 46 ++---- ...userAccounts-passwordResetPendingEmail.ftl | 66 ++------ .../accounts/userAccounts-resetPassword.ftl | 48 +++--- 45 files changed, 826 insertions(+), 610 deletions(-) create mode 100644 webapp/web/i18n/files/accountCreatedEmail.html create mode 100644 webapp/web/i18n/files/accountCreatedEmail.txt create mode 100644 webapp/web/i18n/files/accountCreatedExternalOnlyEmail.html create mode 100644 webapp/web/i18n/files/accountCreatedExternalOnlyEmail.txt create mode 100644 webapp/web/i18n/files/accountEmailChanged.html create mode 100644 webapp/web/i18n/files/accountEmailChanged.txt create mode 100644 webapp/web/i18n/files/accountFirstTimeExternal.html create mode 100644 webapp/web/i18n/files/accountFirstTimeExternal.txt create mode 100644 webapp/web/i18n/files/passwordCreatedEmail.html create mode 100644 webapp/web/i18n/files/passwordCreatedEmail.txt create mode 100644 webapp/web/i18n/files/passwordRequestPending.html create mode 100644 webapp/web/i18n/files/passwordRequestPending.txt create mode 100644 webapp/web/i18n/files/passwordResetComplete.html create mode 100644 webapp/web/i18n/files/passwordResetComplete.txt create mode 100644 webapp/web/i18n/files/passwordResetPending.html create mode 100644 webapp/web/i18n/files/passwordResetPending.txt diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/AbstractPageHandler.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/AbstractPageHandler.java index 3cb19c96d..6aab54794 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/AbstractPageHandler.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/AbstractPageHandler.java @@ -25,6 +25,8 @@ import edu.cornell.mannlib.vitro.webapp.dao.VClassDao; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.dao.jena.ModelContext; import edu.cornell.mannlib.vitro.webapp.dao.jena.OntModelSelector; +import edu.cornell.mannlib.vitro.webapp.i18n.I18n; +import edu.cornell.mannlib.vitro.webapp.i18n.I18nBundle; /** * A base class with some utility routines for page handler (created by @@ -39,6 +41,7 @@ public abstract class AbstractPageHandler { private static final Log log = LogFactory.getLog(AbstractPageHandler.class); protected final VitroRequest vreq; + protected final I18nBundle i18n; protected final ServletContext ctx; protected final OntModel userAccountsModel; protected final OntModel unionModel; @@ -50,6 +53,7 @@ public abstract class AbstractPageHandler { protected AbstractPageHandler(VitroRequest vreq) { this.vreq = vreq; + this.i18n = I18n.bundle(vreq); this.ctx = vreq.getSession().getServletContext(); OntModelSelector oms = ModelContext.getUnionOntModelSelector(ctx); @@ -154,7 +158,8 @@ public abstract class AbstractPageHandler { private static final String ATTRIBUTE = Message.class.getName(); public static void setMessage(HttpServletRequest req, Message message) { - log.debug("Added message to session: " + message.getMessageInfoMap()); + log.debug("Added message to session: " + + message.getMessageInfoMap()); req.getSession().setAttribute(ATTRIBUTE, message); } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsAddPageStrategy.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsAddPageStrategy.java index 19b135bc3..caa52e38a 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsAddPageStrategy.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsAddPageStrategy.java @@ -103,7 +103,7 @@ public abstract class UserAccountsAddPageStrategy extends UserAccountsPage { FreemarkerEmailMessage email = FreemarkerEmailFactory .createNewMessage(vreq); email.addRecipient(TO, page.getAddedAccount().getEmailAddress()); - email.setSubject("Your VIVO account has been created."); + email.setSubject(i18n.text("account_created_subject", getSiteName())); if (page.isExternalAuthOnly()) { email.setTemplate(EMAIL_TEMPLATE_NO_PASSWORD); } else { diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsDeleter.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsDeleter.java index b8484715a..012b9abc6 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsDeleter.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsDeleter.java @@ -2,6 +2,8 @@ package edu.cornell.mannlib.vitro.webapp.controller.accounts.admin; +import static edu.cornell.mannlib.vitro.webapp.controller.accounts.user.UserAccountsUserController.getBogusStandardMessage; + import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -15,7 +17,6 @@ import edu.cornell.mannlib.vitro.webapp.auth.requestedAction.usepages.ManageRoot import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.accounts.UserAccountsPage; -import edu.cornell.mannlib.vitro.webapp.controller.accounts.user.UserAccountsUserController; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; /** @@ -51,7 +52,7 @@ public class UserAccountsDeleter extends UserAccountsPage { UserAccount loggedInAccount = LoginStatusBean.getCurrentUser(vreq); if (loggedInAccount == null) { log.warn("Trying to delete accounts while not logged in!"); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } @@ -61,14 +62,14 @@ public class UserAccountsDeleter extends UserAccountsPage { if (u == null) { log.warn("Delete account for '" + uri + "' is bogus: no such user"); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } if (u.getUri().equals(loggedInAccount.getUri())) { log.warn("'" + u.getUri() + "' is trying to delete his own account."); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } @@ -78,7 +79,7 @@ public class UserAccountsDeleter extends UserAccountsPage { log.warn("Attempting to delete the root account, " + "but not authorized. Logged in as " + LoginStatusBean.getCurrentUser(vreq)); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsEditPage.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsEditPage.java index 0b2e81045..f13c2eab3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsEditPage.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/admin/UserAccountsEditPage.java @@ -2,6 +2,8 @@ package edu.cornell.mannlib.vitro.webapp.controller.accounts.admin; +import static edu.cornell.mannlib.vitro.webapp.controller.accounts.user.UserAccountsUserController.getBogusStandardMessage; + import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -20,7 +22,6 @@ import edu.cornell.mannlib.vitro.webapp.beans.SelfEditingConfiguration; import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.accounts.UserAccountsPage; -import edu.cornell.mannlib.vitro.webapp.controller.accounts.user.UserAccountsUserController; import edu.cornell.mannlib.vitro.webapp.controller.authenticate.Authenticator; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; @@ -116,7 +117,7 @@ public class UserAccountsEditPage extends UserAccountsPage { if (userAccount == null) { log.warn("Edit account for '" + userUri + "' is bogus: no such user"); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } if (userAccount.isRootUser()) { @@ -125,7 +126,7 @@ public class UserAccountsEditPage extends UserAccountsPage { log.warn("User is attempting to edit the root account, " + "but is not authorized to do so. Logged in as: " + LoginStatusBean.getCurrentUser(vreq)); - bogusMessage = UserAccountsUserController.BOGUS_STANDARD_MESSAGE; + bogusMessage = getBogusStandardMessage(vreq); return; } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsCreatePasswordPage.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsCreatePasswordPage.java index b227a0728..3b6585e72 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsCreatePasswordPage.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsCreatePasswordPage.java @@ -46,14 +46,12 @@ public class UserAccountsCreatePasswordPage extends @Override protected String alreadyLoggedInMessage(String currentUserEmail) { - return "You may not activate the account for " + userEmail - + " while you are logged in as " + currentUserEmail - + ". Please log out and try again."; + return i18n.text("cant_activate_while_logged_in", userEmail, currentUserEmail); } @Override protected String passwordChangeNotPendingMessage() { - return "The account for " + userEmail + " has already been activated."; + return i18n.text("account_already_activated", userEmail); } @Override @@ -69,7 +67,7 @@ public class UserAccountsCreatePasswordPage extends FreemarkerEmailMessage email = FreemarkerEmailFactory .createNewMessage(vreq); email.addRecipient(TO, userAccount.getEmailAddress()); - email.setSubject("Password successfully created."); + email.setSubject(i18n.text("password_created_subject", getSiteName())); email.setTemplate(EMAIL_TEMPLATE); email.setBodyMap(body); email.processTemplate(); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPage.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPage.java index 78ea1c7ec..9ac36f700 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPage.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPage.java @@ -115,18 +115,17 @@ public class UserAccountsFirstTimeExternalPage extends UserAccountsPage { private void validateExternalAuthId() { if (externalAuthId.isEmpty()) { - bogusMessage = "Login failed - External ID is not found."; + bogusMessage = i18n.text("external_id_not_provided"); return; } if (null != userAccountsDao .getUserAccountByExternalAuthId(externalAuthId)) { - bogusMessage = "User account already exists for '" + externalAuthId - + "'"; + bogusMessage = i18n.text("external_id_already_in_use", + externalAuthId); return; } if (!Authenticator.getInstance(vreq).isUserPermittedToLogin(null)) { - bogusMessage = "User logins are temporarily disabled " - + "while the system is being maintained."; + bogusMessage = i18n.text("logins_disabled_for_maintenance"); return; } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPageStrategy.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPageStrategy.java index 79ee65e1d..ca1423ad3 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPageStrategy.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsFirstTimeExternalPageStrategy.java @@ -73,7 +73,7 @@ public abstract class UserAccountsFirstTimeExternalPageStrategy extends FreemarkerEmailMessage email = FreemarkerEmailFactory .createNewMessage(vreq); email.addRecipient(TO, ua.getEmailAddress()); - email.setSubject("Your VIVO account has been created."); + email.setSubject(i18n.text("account_created_subject", getSiteName())); email.setTemplate(EMAIL_TEMPLATE); email.setBodyMap(body); email.processTemplate(); diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsMyAccountPageStrategy.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsMyAccountPageStrategy.java index 6d72a941e..b16094631 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsMyAccountPageStrategy.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsMyAccountPageStrategy.java @@ -178,7 +178,7 @@ public abstract class UserAccountsMyAccountPageStrategy extends FreemarkerEmailMessage email = FreemarkerEmailFactory .createNewMessage(vreq); email.addRecipient(TO, page.getUserAccount().getEmailAddress()); - email.setSubject("Your VIVO email account has been changed."); + email.setSubject(i18n.text("email_changed_subject")); email.setTemplate(EMAIL_TEMPLATE); email.setBodyMap(body); email.processTemplate(); 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 1764c9e7a..78e78ce3f 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 @@ -23,8 +23,6 @@ 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"; @@ -79,7 +77,7 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { if (userAccount == null) { log.warn("Password request for '" + userEmail + "' is bogus: no such user"); - bogusMessage = BOGUS_MESSAGE_NO_SUCH_ACCOUNT; + bogusMessage = i18n.text("account_no_longer_exists"); return; } @@ -170,9 +168,9 @@ public abstract class UserAccountsPasswordBasePage extends UserAccountsPage { public String getSuccessMessage() { if (loggedIn) { - return "Your password has been saved."; + return i18n.text("password_saved"); } else { - return "Your password has been saved. Please log in."; + return i18n.text("password_saved_please_login"); } } diff --git a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java index e9b07ba36..9a42ab8c7 100644 --- a/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java +++ b/webapp/src/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java @@ -46,14 +46,13 @@ public class UserAccountsResetPasswordPage extends UserAccountsPasswordBasePage @Override protected String alreadyLoggedInMessage(String currentUserEmail) { - return "You may not reset the password for " + userEmail - + " while you are logged in as " + currentUserEmail - + ". Please log out and try again."; + return i18n.text("cant_change_password_while_logged_in", userEmail, + currentUserEmail); } @Override protected String passwordChangeNotPendingMessage() { - return "The password for " + userEmail + " has already been reset."; + return i18n.text("password_change_not_pending", userEmail); } @Override @@ -69,7 +68,7 @@ public class UserAccountsResetPasswordPage extends UserAccountsPasswordBasePage FreemarkerEmailMessage email = FreemarkerEmailFactory .createNewMessage(vreq); email.addRecipient(TO, userAccount.getEmailAddress()); - email.setSubject("Password changed."); + email.setSubject(i18n.text("password_changed_subject")); email.setTemplate(EMAIL_TEMPLATE); email.setBodyMap(body); email.processTemplate(); 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 e2f7a47e6..eb2d175fe 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 @@ -4,6 +4,8 @@ package edu.cornell.mannlib.vitro.webapp.controller.accounts.user; import static edu.cornell.mannlib.vedit.beans.LoginStatusBean.AuthenticationSource.EXTERNAL; +import javax.servlet.http.HttpServletRequest; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -18,6 +20,7 @@ import edu.cornell.mannlib.vitro.webapp.controller.authenticate.LoginRedirector; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.RedirectResponseValues; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; +import edu.cornell.mannlib.vitro.webapp.i18n.I18n; /** * Parcel out the different actions required of the UserAccounts GUI. @@ -26,8 +29,6 @@ public class UserAccountsUserController extends FreemarkerHttpServlet { private static final Log log = LogFactory .getLog(UserAccountsUserController.class); - 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"; private static final String ACTION_MY_ACCOUNT = "/myAccount"; @@ -116,7 +117,7 @@ public class UserAccountsUserController extends FreemarkerHttpServlet { return showLoginRedirection(vreq, page.getAfterLoginUrl()); } catch (LoginNotPermitted e) { // This should have been anticipated by the page. - return showHomePage(vreq, BOGUS_STANDARD_MESSAGE); + return showHomePage(vreq, getBogusStandardMessage(vreq)); } } else { return page.showPage(); @@ -124,7 +125,7 @@ public class UserAccountsUserController extends FreemarkerHttpServlet { } private ResponseValues handleInvalidRequest(VitroRequest vreq) { - return showHomePage(vreq, BOGUS_STANDARD_MESSAGE); + return showHomePage(vreq, getBogusStandardMessage(vreq)); } private ResponseValues showHomePage(VitroRequest vreq, String message) { @@ -159,4 +160,8 @@ public class UserAccountsUserController extends FreemarkerHttpServlet { } return uri; } + + public static String getBogusStandardMessage(HttpServletRequest req) { + return I18n.bundle(req).text("request_failed"); + } } diff --git a/webapp/web/i18n/all.properties b/webapp/web/i18n/all.properties index ce912c828..ad5ec0618 100644 --- a/webapp/web/i18n/all.properties +++ b/webapp/web/i18n/all.properties @@ -71,3 +71,148 @@ imageUpload.errorNoPhotoSelected = Please browse and select a photo. imageUpload.errorBadMultipartRequest = Failed to parse the multi-part request for uploading an image. imageUpload.errorFormFieldMissing = The form did not contain a ''{0}'' field." +# +# User Accounts pages +# +account_management = Account Management +user_accounts_link = User accounts +user_accounts_title = user accounts + +login_count = Login count +last_login = Last Login + +add_new_account = Add new account +edit_account = Edit account +external_auth_only = Externally Authenticated Only +reset_password = Reset password +reset_password_note = Note: Instructions for resetting the password will \ + be emailed to the address entered above. The password will not \ + be reset until the user follows the link provided in this email. +new_password = New password +confirm_password = Confirm new password +minimum_password_length = Minimum of {0} characters in length. +leave_password_unchanged = Leaving this blank means that the password will not be changed. +confirm_initial_password = Confirm initial password + +new_account_1 = A new account for +new_account_2 = was successfully created. +new_account_title = new account +new_account_notification = A notification email has been sent to {0} \ + with instructions for activating the account and creating a password. +updated_account_1 = The account for +updated_account_2 = has been updated. +updated_account_title = updated account +updated_account_notification = A confirmation email has been sent to {0} \ + with instructions for resetting a password. \ + The password will not be reset until the user follows the link provided in this email. +deleted_accounts = Deleted {0} {0, choice, 0#accounts |1#account |1 + + {1} + + +

+ {2} {3} +

+ +

+ Congratulations! +

+ +

+ We have created your new account on {0}, associated with {4}. +

+ +

+ If you did not request this new account you can safely ignore this email. + This request will expire if not acted upon for 30 days. +

+ +

+ Click the link below to create your password for your new account using our secure server. +

+ +

+ {5} +

+ +

+ If the link above doesn't work, you can copy and paste the link directly into your browser's address bar. +

+ +

+ Thanks! +

+ + diff --git a/webapp/web/i18n/files/accountCreatedEmail.txt b/webapp/web/i18n/files/accountCreatedEmail.txt new file mode 100644 index 000000000..4dcd900c8 --- /dev/null +++ b/webapp/web/i18n/files/accountCreatedEmail.txt @@ -0,0 +1,17 @@ +{2} {3} + +Congratulations! + +We have created your new account on {0}, +associated with {4}. + +If you did not request this new account you can safely ignore this email. +This request will expire if not acted upon for 30 days. + +Paste the link below into your browser's address bar to create your password +for your new account using our secure server. + +{5} + +Thanks! + diff --git a/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.html b/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.html new file mode 100644 index 000000000..164bf87ae --- /dev/null +++ b/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.html @@ -0,0 +1,22 @@ + + + ${1} + + +

+ ${2} ${3} +

+ +

+ Congratulations! +

+ +

+ We have created your new VIVO account associated with ${4}. +

+ +

+ Thanks! +

+ + diff --git a/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.txt b/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.txt new file mode 100644 index 000000000..c55cb3f9a --- /dev/null +++ b/webapp/web/i18n/files/accountCreatedExternalOnlyEmail.txt @@ -0,0 +1,9 @@ +${2} ${3} + +Congratulations! + +We have created your new VIVO account associated with +${4}. + +Thanks! + diff --git a/webapp/web/i18n/files/accountEmailChanged.html b/webapp/web/i18n/files/accountEmailChanged.html new file mode 100644 index 000000000..5a2e51e50 --- /dev/null +++ b/webapp/web/i18n/files/accountEmailChanged.html @@ -0,0 +1,19 @@ + + + {1} + + +

+ Hi, {2} ${3} +

+ +

+ You recently changed the email address associated with + ${2} ${3} +

+ +

+ Thank you. +

+ + diff --git a/webapp/web/i18n/files/accountEmailChanged.txt b/webapp/web/i18n/files/accountEmailChanged.txt new file mode 100644 index 000000000..5f560dca1 --- /dev/null +++ b/webapp/web/i18n/files/accountEmailChanged.txt @@ -0,0 +1,6 @@ +Hi, {2} {3} + +You recently changed the email address associated with +{2} {3} + +Thank you. diff --git a/webapp/web/i18n/files/accountFirstTimeExternal.html b/webapp/web/i18n/files/accountFirstTimeExternal.html new file mode 100644 index 000000000..61dca7f3c --- /dev/null +++ b/webapp/web/i18n/files/accountFirstTimeExternal.html @@ -0,0 +1,22 @@ + + + {1} + + +

+ {2} {3} +

+ +

+ Congratulations! +

+ +

+ We have created your new {0} account associated with {4}. +

+ +

+ Thanks! +

+ + diff --git a/webapp/web/i18n/files/accountFirstTimeExternal.txt b/webapp/web/i18n/files/accountFirstTimeExternal.txt new file mode 100644 index 000000000..1cb60552b --- /dev/null +++ b/webapp/web/i18n/files/accountFirstTimeExternal.txt @@ -0,0 +1,8 @@ +{2} {3} + +Congratulations! + +We have created your new {0} account associated with +{4} + +Thanks! diff --git a/webapp/web/i18n/files/passwordCreatedEmail.html b/webapp/web/i18n/files/passwordCreatedEmail.html new file mode 100644 index 000000000..15cf8bb0d --- /dev/null +++ b/webapp/web/i18n/files/passwordCreatedEmail.html @@ -0,0 +1,22 @@ + + + {1} + + +

+ {2} {3} +

+ +

+ Password successfully created. +

+ +

+ Your new password associated with {4} has been created. +

+ +

+ Thank you. +

+ + diff --git a/webapp/web/i18n/files/passwordCreatedEmail.txt b/webapp/web/i18n/files/passwordCreatedEmail.txt new file mode 100644 index 000000000..dbd9e9da0 --- /dev/null +++ b/webapp/web/i18n/files/passwordCreatedEmail.txt @@ -0,0 +1,8 @@ +{2} {3} + +Password successfully created. + +Your new password associated with {4} +has been created. + +Thank you. diff --git a/webapp/web/i18n/files/passwordRequestPending.html b/webapp/web/i18n/files/passwordRequestPending.html new file mode 100644 index 000000000..bd20cb392 --- /dev/null +++ b/webapp/web/i18n/files/passwordRequestPending.html @@ -0,0 +1,34 @@ + + + {1} + + +

+ Dear {2} {3}: +

+ +

+ We have received a request to reset the password for your {0} account ({4}). +

+ +

+ Please follow the instructions below to proceed with your password reset. +

+ +

+ If you did not request this new account you can safely ignore this email. + This request will expire if not acted upon within 30 days. +

+ +

+ Click on the link below or paste it into your browser's address bar to reset your password + using our secure server. +

+ +

+ {5} +

+ +

Thank you!

+ + diff --git a/webapp/web/i18n/files/passwordRequestPending.txt b/webapp/web/i18n/files/passwordRequestPending.txt new file mode 100644 index 000000000..e8c92b5f2 --- /dev/null +++ b/webapp/web/i18n/files/passwordRequestPending.txt @@ -0,0 +1,16 @@ +Dear {2} {3}: + +We have received a request to reset the password for your {0} account +({4}). + +Please follow the instructions below to proceed with your password reset. + +If you did not request this new account you can safely ignore this email. +This request will expire if not acted upon within 30 days. + +Paste the link below into your browser's address bar to reset your password +using our secure server. + +{5} + +Thank you! diff --git a/webapp/web/i18n/files/passwordResetComplete.html b/webapp/web/i18n/files/passwordResetComplete.html new file mode 100644 index 000000000..bfa756f15 --- /dev/null +++ b/webapp/web/i18n/files/passwordResetComplete.html @@ -0,0 +1,22 @@ + + + {1} + + +

+ {2} {3} +

+ +

+ Password successfully changed. +

+ +

+ Your new password associated with {4} has been changed. +

+ +

+ Thank you. +

+ + diff --git a/webapp/web/i18n/files/passwordResetComplete.txt b/webapp/web/i18n/files/passwordResetComplete.txt new file mode 100644 index 000000000..99503085c --- /dev/null +++ b/webapp/web/i18n/files/passwordResetComplete.txt @@ -0,0 +1,8 @@ +{2} {3} + +Password successfully changed. + +Your new password associated with {4} +has been changed. + +Thank you. diff --git a/webapp/web/i18n/files/passwordResetPending.html b/webapp/web/i18n/files/passwordResetPending.html new file mode 100644 index 000000000..bd20cb392 --- /dev/null +++ b/webapp/web/i18n/files/passwordResetPending.html @@ -0,0 +1,34 @@ + + + {1} + + +

+ Dear {2} {3}: +

+ +

+ We have received a request to reset the password for your {0} account ({4}). +

+ +

+ Please follow the instructions below to proceed with your password reset. +

+ +

+ If you did not request this new account you can safely ignore this email. + This request will expire if not acted upon within 30 days. +

+ +

+ Click on the link below or paste it into your browser's address bar to reset your password + using our secure server. +

+ +

+ {5} +

+ +

Thank you!

+ + diff --git a/webapp/web/i18n/files/passwordResetPending.txt b/webapp/web/i18n/files/passwordResetPending.txt new file mode 100644 index 000000000..5d34952f3 --- /dev/null +++ b/webapp/web/i18n/files/passwordResetPending.txt @@ -0,0 +1,16 @@ +Dear {2} {3}: + +We have received a request to reset the password for your {0} account +({4}). + +Please follow the instructions below to proceed with your password reset. + +If you did not request this new account you can safely ignore this email. +This request will expire if not acted upon within 30 days. + +Paste the link below into your browser's address bar to reset your password +using our secure server. + +{5} + +Thank you! \ No newline at end of file diff --git a/webapp/web/js/account/accountUtils.js b/webapp/web/js/account/accountUtils.js index 134009f61..26b0f75aa 100644 --- a/webapp/web/js/account/accountUtils.js +++ b/webapp/web/js/account/accountUtils.js @@ -45,7 +45,7 @@ $(document).ready(function(){ if (countAccount == 0){ return false; }else{ - var answer = confirm( 'Are you sure you want to delete ' + ((countAccount > 1) ? 'these accounts' : 'this account') +'?'); + var answer = confirm( ((countAccount > 1) ? confirm_delete_account_plural : confirm_delete_account_singular) +'?'); return answer; } }); diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl index 35bb89956..a855f13c8 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedEmail.ftl @@ -2,67 +2,22 @@ <#-- Confirmation that an account has been created. --> -<#assign subject = "Your ${siteName} account has been created." /> +<#assign strings = i18n() /> -<#assign html> - - - ${subject} - - -

- ${userAccount.firstName} ${userAccount.lastName} -

- -

- Congratulations! -

- -

- We have created your new account on ${siteName}, associated with ${userAccount.emailAddress}. -

- -

- If you did not request this new account you can safely ignore this email. - This request will expire if not acted upon for 30 days. -

- -

- Click the link below to create your password for your new account using our secure server. -

- -

- ${passwordLink} -

- -

- If the link above doesn't work, you can copy and paste the link directly into your browser's address bar. -

- -

- Thanks! -

- - - +<#assign subject = strings.account_created(siteName) /> -<#assign text> -${userAccount.firstName} ${userAccount.lastName} +<#assign html = strings.account_created_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress, + passwordLink) /> -Congratulations! - -We have created your new account on ${siteName}, -associated with ${userAccount.emailAddress}. - -If you did not request this new account you can safely ignore this email. -This request will expire if not acted upon for 30 days. - -Paste the link below into your browser's address bar to create your password -for your new account using our secure server. - -${passwordLink} - -Thanks! - +<#assign text = strings.account_created_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress, + passwordLink) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedExternalOnlyEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedExternalOnlyEmail.ftl index df2959656..a6bc6f0e9 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedExternalOnlyEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-acctCreatedExternalOnlyEmail.ftl @@ -2,42 +2,18 @@ <#-- Confirmation that an account has been created. --> -<#assign subject = "Your ${siteName} account has been created." /> +<#assign subject = strings.account_created(siteName) /> -<#assign html> - - - ${subject} - - -

- ${userAccount.firstName} ${userAccount.lastName} -

- -

- Congratulations! -

- -

- We have created your new VIVO account associated with ${userAccount.emailAddress}. -

- -

- Thanks! -

- - - +<#assign html = strings.account_created_external_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> -<#assign text> -${userAccount.firstName} ${userAccount.lastName} - -Congratulations! - -We have created your new VIVO account associated with -${userAccount.emailAddress}. - -Thanks! - +<#assign text = string.account_created_external_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl index 26f1eee4a..9ec2e5a22 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-add.ftl @@ -2,71 +2,54 @@ <#-- Template for adding a user account --> -

> Add new account

+<#assign strings = i18n() /> +

> ${strings.add_new_account}

<#if errorEmailIsEmpty??> - <#assign errorMessage = "You must supply an email address." /> + <#assign errorMessage = strings.error_no_email /> + <#elseif errorEmailInUse??> + <#assign errorMessage = strings.error_email_already_exists /> + <#elseif errorEmailInvalidFormat??> + <#assign errorMessage = strings.error_invalid_email(emailAddress) /> + <#elseif errorExternalAuthIdInUse??> + <#assign errorMessage = strings.error_external_auth_already_exists /> + <#elseif errorFirstNameIsEmpty??> + <#assign errorMessage = strings.error_no_first_name /> + <#elseif errorLastNameIsEmpty??> + <#assign errorMessage = strings.error_no_last_name /> + <#elseif errorNoRoleSelected??> + <#assign errorMessage = strings.error_no_role /> + <#elseif errorPasswordIsEmpty??> + <#assign errorMessage = strings.error_no_password /> + <#elseif errorPasswordIsWrongLength??> + <#assign errorMessage = strings.error_password_length(minimumLength, maximumLength) /> + <#elseif errorPasswordsDontMatch??> + <#assign errorMessage = strings.error_password_mismatch /> - - <#if errorEmailInUse??> - <#assign errorMessage = "An account with that email address already exists." /> - - - <#if errorEmailInvalidFormat??> - <#assign errorMessage = "'${emailAddress}' is not a valid email address." /> - - - <#if errorExternalAuthIdInUse??> - <#assign errorMessage = "An account with that external authorization ID already exists." /> - - - <#if errorFirstNameIsEmpty??> - <#assign errorMessage = "You must supply a first name." /> - - - <#if errorLastNameIsEmpty??> - <#assign errorMessage = "You must supply a last name." /> - - - <#if errorNoRoleSelected??> - <#assign errorMessage = "You must select a role." /> - - - <#if errorPasswordIsEmpty??> - <#assign errorMessage = "No password supplied." /> - - - <#if errorPasswordIsWrongLength??> - <#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." /> - - - <#if errorPasswordsDontMatch??> - <#assign errorMessage = "Passwords do not match." /> - - + <#if errorMessage?has_content>
- + - + - + <#include "userAccounts-associateProfilePanel.ftl"> -

checked />Externally Authenticated Only

-

Roles *

+

checked />${strings.external_auth_only}

+

${strings.roles} *

<#list roles as role> @@ -74,25 +57,21 @@ <#if emailIsEnabled??> -

- Note: An email will be sent to the address entered above - notifying that an account has been created. - It will include instructions for activating the account and creating a password. -

+

${strings.new_account_note}

<#else>
- + -

Minimum of ${minimumLength} characters in length.

+

${strings.minimum_password_length}

- +
-

or Cancel

+

${strings.or} ${strings.cancel_link}

-

* required fields

+

* ${strings.required_fields}

diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-associateProfilePanel.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-associateProfilePanel.ftl index f75ef2856..3cf0bedff 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-associateProfilePanel.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-associateProfilePanel.ftl @@ -2,20 +2,22 @@ <#-- Template for setting the account reference field, which can also associate a profile with the user account --> +<#assign strings = i18n() /> + ${stylesheets.add('', '')}
<#if showAssociation??> - + - This Identifier is already in use. -

Can be used to associate the account with the user's profile via the matching property.

+ ${strings.auth_id_in_use} +

${strings.auth_id_explanation}

<#else> - + - This Identifier is already in use. + ${strings.auth_id_in_use}
@@ -24,10 +26,10 @@ ${stylesheets.add('

- + - (verify this match) - (change profile) + (${strings.verify_this_match}) + (${strings.change_profile})

@@ -37,16 +39,16 @@ ${stylesheets.add('

- +

-

- or -

+

- ${strings.or} -

- + - + -

Minimum of ${minimumLength} characters in length.

+

${strings.minimum_password_length(minimumLength)}

- + -

+

-

* required fields

+

* ${strings.required_fields}

diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl index e5b348fdc..a871b8090 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-edit.ftl @@ -2,75 +2,58 @@ <#-- Template for editing a user account --> -

> Edit account

+<#assign strings = i18n() /> +

> ${strings.edit_account}

<#if errorEmailIsEmpty??> - <#assign errorMessage = "You must supply an email address." /> - - - <#if errorEmailInUse??> - <#assign errorMessage = "An account with that email address already exists." /> - - - <#if errorEmailInvalidFormat??> - <#assign errorMessage = "'${emailAddress}' is not a valid email address." /> - - - <#if errorExternalAuthIdInUse??> - <#assign errorMessage = "An account with that external authorization ID already exists." /> - - - <#if errorFirstNameIsEmpty??> - <#assign errorMessage = "You must supply a first name." /> - - - <#if errorLastNameIsEmpty??> - <#assign errorMessage = "You must supply a last name." /> - - - <#if errorNoRoleSelected??> - <#assign errorMessage = "You must select a role." /> - - - <#if errorPasswordIsEmpty??> - <#assign errorMessage = "No password supplied." /> - - - <#if errorPasswordIsWrongLength??> - <#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." /> - - - <#if errorPasswordsDontMatch??> - <#assign errorMessage = "Passwords do not match." /> + <#assign errorMessage = strings.error_no_email /> + <#elseif errorEmailInUse??> + <#assign errorMessage = strings.error_email_already_exists /> + <#elseif errorEmailInvalidFormat??> + <#assign errorMessage = strings.error_invalid_email(emailAddress) /> + <#elseif errorExternalAuthIdInUse??> + <#assign errorMessage = strings.error_external_auth_already_exists /> + <#elseif errorFirstNameIsEmpty??> + <#assign errorMessage = strings.error_no_first_name /> + <#elseif errorLastNameIsEmpty??> + <#assign errorMessage = strings.error_no_last_name /> + <#elseif errorNoRoleSelected??> + <#assign errorMessage = strings.error_no_role /> + <#elseif errorPasswordIsEmpty??> + <#assign errorMessage = strings.error_no_password /> + <#elseif errorPasswordIsWrongLength??> + <#assign errorMessage = strings.error_password_length(minimumLength, maximumLength) /> + <#elseif errorPasswordsDontMatch??> + <#assign errorMessage = strings.error_password_mismatch /> <#if errorMessage?has_content>
- + - + - + <#if externalAuthPermitted??> <#include "userAccounts-associateProfilePanel.ftl"> -

checked />Externally Authenticated Only

+

checked />${strings.external_auth_only}

<#if roles?has_content> -

Roles *

+

${strings.roles} *

<#list roles as role> @@ -81,29 +64,25 @@ <#if emailIsEnabled??>
class="hidden" role="region"> checked /> - + -

- Note: Instructions for resetting the password will - be emailed to the address entered above. The password will not - be reset until the user follows the link provided in this email. -

+

${strings.reset_password_note}

<#else>
class="hidden" role="region"> - + -

Minimum of ${minimumLength} characters in length.
- Leaving this blank means that the password will not be changed.

+

${strings.minimum_password_length(minimumLength)}
+ ${strings.leave_password_unchanged}

- +
-

or Cancel

+

${strings.or} ${strings.cancel_link}

-

* required fields

+

* ${strings.required_fields}

diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternal.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternal.ftl index a1f725bca..96bdb70eb 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternal.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternal.ftl @@ -2,59 +2,55 @@ <#-- Template for creating an account for the first time an external user logs in. --> -

First time log in

+<#assign strings = i18n() /> + +

${strings.first_time_login}

<#if errorEmailIsEmpty??> - <#assign errorMessage = "You must supply an email address." /> + <#assign errorMessage = strings.error_no_email /> + <#elseif errorEmailInUse??> + <#assign errorMessage = strings.error_email_already_exists /> + <#elseif errorEmailInvalidFormat??> + <#assign errorMessage = strings.error_invalid_email(emailAddress) /> + <#elseif errorFirstNameIsEmpty??> + <#assign errorMessage = strings.error_no_first_name /> + <#elseif errorLastNameIsEmpty??> + <#assign errorMessage = strings.error_no_last_name /> - - <#if errorEmailInUse??> - <#assign errorMessage = "An account with that email address already exists." /> - - - <#if errorEmailInvalidFormat??> - <#assign errorMessage = "'${emailAddress}' is not a valid email address." /> - - - <#if errorFirstNameIsEmpty??> - <#assign errorMessage = "You must supply a first name." /> - - - <#if errorLastNameIsEmpty??> - <#assign errorMessage = "You must supply a last name." /> - - + <#if errorMessage?has_content>
-

Please provide your contact information to finish creating your account.

+

${strings.please_provide_contact_information}

- + - + - + <#if emailIsEnabled??> -

- Note: An email will be sent to the address entered above notifying - that an account has been created. -

+

${strings.first_time_login_note}

-

or Cancel

+

+ ${strings.or} + ${strings.cancel_link} +

+ +

* ${strings.required_fields}

diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternalEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternalEmail.ftl index a7b6cae83..247cc42b4 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternalEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-firstTimeExternalEmail.ftl @@ -2,42 +2,20 @@ <#-- Confirmation that an account has been created for an externally-authenticated user. --> -<#assign subject = "Your ${siteName} account has been created." /> +<#assign strings = i18n() /> -<#assign html> - - - ${subject} - - -

- ${userAccount.firstName} ${userAccount.lastName} -

- -

- Congratulations! -

- -

- We have created your new VIVO account associated with ${userAccount.emailAddress}. -

- -

- Thanks! -

- - - +<#assign subject = strings.account_created(siteName) /> -<#assign text> -${userAccount.firstName} ${userAccount.lastName} +<#assign html = strings.first_time_external_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> -Congratulations! - -We have created your new VIVO account associated with -${userAccount.emailAddress}. - -Thanks! - +<#assign text = strings.first_time_external_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-list.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-list.ftl index 70b9c3e60..d9c5aa06c 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-list.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-list.ftl @@ -4,20 +4,19 @@ <#import "userAccounts-accountsNav.ftl" as p> +<#assign strings = i18n() /> +
-

User accounts |

+

${strings.user_accounts_link} |

<#if newUserAccount?? > @@ -25,14 +24,10 @@ <#if updatedUserAccount?? > @@ -40,7 +35,7 @@ <#if deletedAccountCount?? > @@ -48,7 +43,7 @@
<#if roleFilterUri?has_content> - View all accounts + ${strings.view_all_accounts}
@@ -68,7 +63,7 @@
- + <#else> @@ -156,7 +151,7 @@ <#if account.editUrl != ""> - ${account.emailAddress} + ${account.emailAddress} <#else> ${account.emailAddress} @@ -185,5 +180,10 @@ <@p.accountsNav />
+ + ${stylesheets.add('')} ${scripts.add('')} \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl index 27add004a..8f8c8bd00 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-myAccount.ftl @@ -2,58 +2,48 @@ <#-- Template for editing a user account --> -

My account

+<#assign strings = i18n() /> + +

${strings.myAccount_heading}

<#if errorEmailIsEmpty??> - <#assign errorMessage = "You must supply an email address." /> + <#assign errorMessage = strings.error_no_email /> + <#elseif errorEmailInUse??> + <#assign errorMessage = strings.error_email_already_exists /> + <#elseif errorEmailInvalidFormat??> + <#assign errorMessage = strings.error_invalid_email(emailAddress) /> + <#elseif errorFirstNameIsEmpty??> + <#assign errorMessage = strings.error_no_first_name /> + <#elseif errorLastNameIsEmpty??> + <#assign errorMessage = strings.error_no_last_name /> + <#elseif errorNoRoleSelected??> + <#assign errorMessage = strings.error_no_role /> + <#elseif errorPasswordIsEmpty??> + <#assign errorMessage = strings.error_no_password /> + <#elseif errorPasswordIsWrongLength??> + <#assign errorMessage = strings.error_password_length(minimumLength, maximumLength) /> + <#elseif errorPasswordsDontMatch??> + <#assign errorMessage = strings.error_password_mismatch /> - - <#if errorEmailInUse??> - <#assign errorMessage = "An account with that email address already exists." /> - - - <#if errorEmailInvalidFormat??> - <#assign errorMessage = "'${emailAddress}' is not a valid email address." /> - - - <#if errorFirstNameIsEmpty??> - <#assign errorMessage = "You must supply a first name." /> - - - <#if errorLastNameIsEmpty??> - <#assign errorMessage = "You must supply a last name." /> - - - <#if errorPasswordIsEmpty??> - <#assign errorMessage = "No password supplied." /> - - - <#if errorPasswordIsWrongLength??> - <#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." /> - - - <#if errorPasswordsDontMatch??> - <#assign errorMessage = "Passwords do not match." /> - - + <#if errorMessage?has_content> <#if confirmChange??> - <#assign confirmMessage = "Your changes have been saved." /> + <#assign confirmMessage = strings.myAccount_confirm_changes /> <#if confirmEmailSent??> - <#assign confirmMessage = "Your changes have been saved. A confirmation email has been sent to ${emailAddress}." /> + <#assign confirmMessage = strings.myAccount_confirm_changes_plus_note(emailAddress) /> <#if confirmMessage?has_content> @@ -63,30 +53,34 @@ <#include "userAccounts-myProxiesPanel.ftl"> - + -

Note: if email changes, a confirmation email will
be sent to the new email address entered above.

+

${strings.email_change_will_be_confirmed}

- + - + <#if !externalAuth??> - + -

Minimum of ${minimumLength} characters in length.
If left blank, the password will not be changed.

+

${strings.minimum_password_length(minimumLength)}
${strings.leave_password_unchanged}

- + -

or Cancel

+

+ + ${strings.or} + ${strings.cancel_link} +

-

* required fields

+

* ${strings.required_fields}

diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl index 8c27c659f..02edecc87 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-myProxiesPanel.ftl @@ -2,15 +2,21 @@ <#-- Template for setting the account reference field, which can also associate a profile with the user account --> +<#assign strings = i18n() /> +
-

Who can edit my profile

+

${strings.who_can_edit_profile}

- - + + + -

 

+

+   +

${myAccountUri}

-

Selected editors:

+

${strings.selected_editors}:

<#-- Magic ul that holds all of the proxy data and the template that shows how to display it. -->
    @@ -35,7 +41,7 @@

    %label% | %classLabel%
    - Remove selection + ${strings.remove_selection}

    diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordCreatedEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordCreatedEmail.ftl index 4177027ab..1a4941549 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordCreatedEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordCreatedEmail.ftl @@ -2,42 +2,20 @@ <#-- Confirmation that an password has been created. --> -<#assign subject = "Your ${siteName} password has successfully been created." /> +<#assign strings = i18n() /> -<#assign html> - - - ${subject} - - -

    - ${userAccount.firstName} ${userAccount.lastName} -

    - -

    - Password successfully created. -

    - -

    - Your new password associated with ${userAccount.emailAddress} has been created. -

    - -

    - Thank you. -

    - - - +<#assign subject = strings.password_created_subject(siteName) /> -<#assign text> -${userAccount.firstName} ${userAccount.lastName} +<#assign html = strings.password_created_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> -Password successfully created. - -Your new password associated with ${userAccount.emailAddress} -has been created. - -Thank you. - +<#assign text = strings.password_created_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetCompleteEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetCompleteEmail.ftl index 8fd529c79..8badf9f3b 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetCompleteEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetCompleteEmail.ftl @@ -2,42 +2,20 @@ <#-- Confirmation that a password has been reset. --> -<#assign subject = "Your ${siteName} password changed." /> +<#assign strings = i18n() /> -<#assign html> - - - ${subject} - - -

    - ${userAccount.firstName} ${userAccount.lastName} -

    - -

    - Password successfully changed. -

    - -

    - Your new password associated with ${userAccount.emailAddress} has been changed. -

    - -

    - Thank you. -

    - - - +<#assign subject = strings.password_reset_complete_subject(siteName) /> -<#assign text> -${userAccount.firstName} ${userAccount.lastName} +<#assign html = strings.password_reset_complete_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> -Password successfully changed. - -Your new password associated with ${userAccount.emailAddress} -has been changed. - -Thank you. - +<#assign text = strings.password_reset_complete_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetPendingEmail.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetPendingEmail.ftl index d6fcc59a2..e02bdfd9a 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetPendingEmail.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-passwordResetPendingEmail.ftl @@ -2,60 +2,22 @@ <#-- Confirmation email for user account password reset --> -<#assign subject = "${siteName} reset password request" /> +<#assign strings = i18n() /> -<#assign html> - - - ${subject} - - -

    - Dear ${userAccount.firstName} ${userAccount.lastName}: -

    - -

    - We have received a request to reset the password for your ${siteName} account (${userAccount.emailAddress}). -

    - -

    - Please follow the instructions below to proceed with your password reset. -

    - -

    - If you did not request this new account you can safely ignore this email. - This request will expire if not acted upon within 30 days. -

    - -

    - Click on the link below or paste it into your browser's address bar to reset your password - using our secure server. -

    - -

    ${passwordLink}

    - -

    Thank you!

    - - - +<#assign subject = strings.password_reset_pending_subject(siteName) /> -<#assign text> -Dear ${userAccount.firstName} ${userAccount.lastName}: - -We have received a request to reset the password for your ${siteName} account -(${userAccount.emailAddress}). +<#assign html = strings.password_reset_pending_email_html(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress, + passwordLink) /> -Please follow the instructions below to proceed with your password reset. - -If you did not request this new account you can safely ignore this email. -This request will expire if not acted upon within 30 days. - -Paste the link below into your browser's address bar to reset your password -using our secure server. - -${passwordLink} - -Thank you! - +<#assign text = strings.password_reset_pending_email_text(siteName, + subject, + userAccount.firstName, + userAccount.lastName, + userAccount.emailAddress, + passwordLink) /> <@email subject=subject html=html text=text /> \ No newline at end of file diff --git a/webapp/web/templates/freemarker/body/accounts/userAccounts-resetPassword.ftl b/webapp/web/templates/freemarker/body/accounts/userAccounts-resetPassword.ftl index d7630d5fb..0ca4be7b6 100644 --- a/webapp/web/templates/freemarker/body/accounts/userAccounts-resetPassword.ftl +++ b/webapp/web/templates/freemarker/body/accounts/userAccounts-resetPassword.ftl @@ -2,45 +2,43 @@ <#-- Template for adding a user account --> -

    Reset your Password

    +<#assign strings = i18n() /> -

    Please enter your new password for ${userAccount.emailAddress}

    +

    ${strings.reset_your_password}

    - <#if errorPasswordIsEmpty??> - <#assign errorMessage = "No password supplied." /> - - - <#if errorPasswordIsWrongLength??> - <#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." /> - - - <#if errorPasswordsDontMatch??> - <#assign errorMessage = "Passwords do not match." /> - - - <#if errorMessage?has_content> - - +

    ${strings.enter_new_password(userAccount.emailAddress)}

    + +<#if errorPasswordIsEmpty??> + <#assign errorMessage = strings.error_no_password /> +<#elseif errorPasswordIsWrongLength??> + <#assign errorMessage = strings.error_password_length(minimumLength, maximumLength) /> +<#elseif errorPasswordsDontMatch??> + <#assign errorMessage = strings.error_password_mismatch /> + + +<#if errorMessage?has_content> + +
    - + -

    Minimum of ${minimumLength} characters in length.

    +

    ${strings.minimum_password_length(minimumLength)}

    - + -

    +

    -

    * required fields

    +

    * ${strings.required_fields}