From 051cb5e0ef328586bfbaea05f1fa621ceee70591 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 29 Sep 2023 16:20:26 +0200 Subject: [PATCH 01/63] Added forgot password servlet as well as some UI and i18n files changes. --- .../authenticate/ForgotPassword.java | 123 ++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 24 ++++ .../freemarker/widgets/widget-login.ftl | 27 ++++ 3 files changed, 174 insertions(+) create mode 100644 api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java new file mode 100644 index 0000000000..6a285728fd --- /dev/null +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -0,0 +1,123 @@ +package edu.cornell.mannlib.vitro.webapp.controller.authenticate; + +import java.io.IOException; +import java.io.PrintWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import javax.mail.Message; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; +import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; +import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.dao.UserAccountsDao; +import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; +import edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory; +import edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailMessage; +import edu.cornell.mannlib.vitro.webapp.i18n.I18n; +import edu.cornell.mannlib.vitro.webapp.i18n.I18nBundle; +import edu.cornell.mannlib.vitro.webapp.modelaccess.ModelAccess; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +@WebServlet(name = "forgot-password", urlPatterns = {"/forgot-password"}) +public class ForgotPassword extends VitroHttpServlet { + + public static final String RESET_PASSWORD_URL = "/accounts/resetPassword"; + + protected static final int DAYS_TO_USE_PASSWORD_LINK = 5; + + private static final Log log = LogFactory.getLog(ForgotPassword.class + .getName()); + + @Override + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + response.setContentType("text/html"); + PrintWriter out = response.getWriter(); + + VitroRequest vreq = new VitroRequest(request); + I18nBundle i18n = I18n.bundle(vreq); + String email = request.getParameter("email"); + + UserAccount userAccount = getAccountForInternalAuth(email, request); + if (userAccount == null) { + out.println("

" + i18n.text("password_reset_email_non_existing") + "

"); + } + + userAccount.setPasswordLinkExpires(figureExpirationDate().getTime()); + userAccount.generateEmailKey(); + userAccount.setStatus(UserAccount.Status.INACTIVE); + + notifyUser(userAccount, i18n, vreq); + + out.println("

" + i18n.text("password_reset_email_sent") + email + "

"); + } + + protected void notifyUser(UserAccount userAccount, I18nBundle i18n, + VitroRequest vreq) { + + Map body = new HashMap(); + body.put("userAccount", userAccount); + body.put("passwordLink", + buildResetPasswordLink(userAccount.getEmailAddress(), userAccount.getEmailKey(), vreq)); + body.put("siteName", vreq.getAppBean().getApplicationName()); + body.put("subject", i18n.text("password_reset_pending_email_subject")); + body.put("textMessage", i18n.text("password_reset_pending_email_plain_text")); + body.put("htmlMessage", i18n.text("password_reset_pending_email_html_text")); + + FreemarkerEmailMessage emailMessage = FreemarkerEmailFactory + .createNewMessage(vreq); + emailMessage.addRecipient(Message.RecipientType.TO, userAccount.getEmailAddress()); + emailMessage.setBodyMap(body); + emailMessage.processTemplate(); + emailMessage.send(); + } + + public UserAccount getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { + UserAccountsDao userAccountsDao = getUserAccountsDao(request); + if (userAccountsDao == null) { + return null; + } + return userAccountsDao.getUserAccountByEmail(emailAddress); + } + + private UserAccountsDao getUserAccountsDao(HttpServletRequest request) { + UserAccountsDao userAccountsDao = getWebappDaoFactory(request) + .getUserAccountsDao(); + if (userAccountsDao == null) { + log.error("getUserAccountsDao: no UserAccountsDao"); + } + + return userAccountsDao; + } + + private WebappDaoFactory getWebappDaoFactory(HttpServletRequest request) { + return ModelAccess.on(request).getWebappDaoFactory(); + } + + private String buildResetPasswordLink(String email, String key, VitroRequest vreq) { + try { + String relativeUrl = UrlBuilder.getUrl(RESET_PASSWORD_URL, "user", email, "key", key); + + URL context = new URL(vreq.getRequestURL().toString()); + URL url = new URL(context, relativeUrl); + return url.toExternalForm(); + } catch (MalformedURLException e) { + return "error_creating_password_link"; + } + } + + private Date figureExpirationDate() { + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, DAYS_TO_USE_PASSWORD_LINK); + return c.getTime(); + } +} \ No newline at end of file diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index ab0b41be4b..4bf2316198 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,30 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Password recovery email sent to "@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Email you have provided is not associated with any user account."@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "I forgot my password"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index 10cd4dda04..b62b5bc225 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -73,6 +73,33 @@ +
+ + +
+ + + + + From 4926978b824b9e2172d22551ddbee17cd3760a22 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 29 Sep 2023 17:11:07 +0200 Subject: [PATCH 02/63] Moved labels in the correct language file. --- .../firsttime/vitro_UiLabel.ttl | 24 ------------------- .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 4bf2316198..ab0b41be4b 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,30 +254,6 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_sent.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Password recovery email sent to "@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_email_non_existing.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Email you have provided is not associated with any user account."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_label.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "I forgot my password"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 332b43c651..ea74501ca4 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,30 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Password recovery email sent to "@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Email you have provided is not associated with any user account."@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "I forgot my password"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; From 65f629cab941909ad838e7f18605c4e4914ecb39 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 2 Oct 2023 15:12:28 +0200 Subject: [PATCH 03/63] Implemented localisation and delayed successive requests to prevent SPAM messages. Fixed dao saving bug. --- .../authenticate/ForgotPassword.java | 75 +++++++++++++++---- .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 16 ++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++ 9 files changed, 358 insertions(+), 13 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index 6a285728fd..b3fd1f6170 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -4,12 +4,14 @@ import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; +import java.time.LocalDateTime; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; import javax.mail.Message; +import javax.servlet.ServletContext; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; @@ -31,38 +33,58 @@ @WebServlet(name = "forgot-password", urlPatterns = {"/forgot-password"}) public class ForgotPassword extends VitroHttpServlet { - public static final String RESET_PASSWORD_URL = "/accounts/resetPassword"; + private static final String RESET_PASSWORD_URL = "/accounts/resetPassword"; - protected static final int DAYS_TO_USE_PASSWORD_LINK = 5; + private static final int DAYS_TO_USE_PASSWORD_LINK = 5; + + private static final Log log = LogFactory.getLog(ForgotPassword.class.getName()); + + private static final Map requestHistory = new HashMap<>(); + + private static final Map requestFrequency = new HashMap<>(); - private static final Log log = LogFactory.getLog(ForgotPassword.class - .getName()); @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { - response.setContentType("text/html"); - PrintWriter out = response.getWriter(); + public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { + PrintWriter out = setupResponsePrintWriter(response); + log.info("Password reset requested from client: " + request.getRemoteAddr()); VitroRequest vreq = new VitroRequest(request); + UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); + String email = request.getParameter("email"); UserAccount userAccount = getAccountForInternalAuth(email, request); if (userAccount == null) { out.println("

" + i18n.text("password_reset_email_non_existing") + "

"); + return; } - userAccount.setPasswordLinkExpires(figureExpirationDate().getTime()); - userAccount.generateEmailKey(); - userAccount.setStatus(UserAccount.Status.INACTIVE); + clearOrInitializeHistoryRequestData(userAccount); + + Integer numberOfSuccessiveRequests = requestFrequency.get(email); + LocalDateTime momentOfFirstRequest = requestHistory.get(email); + LocalDateTime nextRequestAvailableAt = momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * 10); + if (nextRequestAvailableAt.isAfter(LocalDateTime.now())) { + String[] dateTimeTokens = nextRequestAvailableAt.toString().split("T"); + String dateString = dateTimeTokens[0]; + String timeString = dateTimeTokens[1].split("\\.")[0]; + out.println( + "

" + i18n.text("password_reset_too_many_requests") + dateString + + i18n.text("password_reset_too_many_requests_at_time") + timeString + "

"); + return; + } + requestPasswordChange(userAccount, userAccountsDao); notifyUser(userAccount, i18n, vreq); + requestFrequency.computeIfPresent(email, (key, value) -> ++value); out.println("

" + i18n.text("password_reset_email_sent") + email + "

"); } - protected void notifyUser(UserAccount userAccount, I18nBundle i18n, - VitroRequest vreq) { + private void notifyUser(UserAccount userAccount, I18nBundle i18n, + VitroRequest vreq) { Map body = new HashMap(); body.put("userAccount", userAccount); @@ -81,7 +103,34 @@ protected void notifyUser(UserAccount userAccount, I18nBundle i18n, emailMessage.send(); } - public UserAccount getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { + private UserAccountsDao constructUserAccountsDao(VitroRequest vreq) { + ServletContext ctx = vreq.getSession().getServletContext(); + WebappDaoFactory wdf = ModelAccess.on(ctx).getWebappDaoFactory(); + return wdf.getUserAccountsDao(); + } + + private PrintWriter setupResponsePrintWriter(HttpServletResponse response) throws IOException { + response.setContentType("text/html"); + return response.getWriter(); + } + + private void requestPasswordChange(UserAccount userAccount, UserAccountsDao userAccountsDao) { + userAccount.setPasswordLinkExpires(figureExpirationDate().getTime()); + userAccount.generateEmailKey(); + userAccount.setPasswordChangeRequired(true); + userAccountsDao.updateUserAccount(userAccount); + } + + private void clearOrInitializeHistoryRequestData(UserAccount userAccount) { + if (userAccount.isPasswordChangeRequired()) { + requestHistory.putIfAbsent(userAccount.getEmailAddress(), LocalDateTime.now()); + } else { + requestHistory.put(userAccount.getEmailAddress(), LocalDateTime.now()); + requestFrequency.put(userAccount.getEmailAddress(), 0); + } + } + + private UserAccount getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { UserAccountsDao userAccountsDao = getUserAccountsDao(request); if (userAccountsDao == null) { return null; diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index ab0b41be4b..ac843a5572 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "E-Mail zur Passwortwiederherstellung gesendet an "@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Die von Ihnen angegebene E-Mail-Adresse ist keinem Benutzerkonto zugeordnet."@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Die nächste Anfrage können Sie am "@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " um "@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "I forgot my password"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index d4a455c232..9c7403d0b0 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Password recovery email sent to "@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Email you have provided is not associated with any user account."@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "You will be able to send the next request on "@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " at "@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "I forgot my password"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index ea74501ca4..fd84de921e 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,22 @@ uil-data:password_reset_email_non_existing.Vitro uil:hasKey "password_reset_email_non_existing" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "You will be able to send the next request on "@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " at "@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index a2e04ae6cb..3f10ee9b1a 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Correo electrónico de recuperación de contraseña enviado a "@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "El correo electrónico que ha proporcionado no está asociado con ninguna cuenta de usuario."@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Podrás enviar la próxima solicitud el "@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " a las "@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Olvidé mi contraseña"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index ebe0af3875..5bced64f31 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "E-mail de récupération de mot de passe envoyé à "@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "L'e-mail que vous avez fourni n'est associé à aucun compte utilisateur."@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Vous pourrez envoyer la prochaine demande le "@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " à "@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "J'ai oublié mon mot de passe"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index f965878320..607e7b230f 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "E-mail de recuperação de senha enviado para "@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "O e-mail que você forneceu não está associado a nenhuma conta de usuário."@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Você poderá enviar a próxima solicitação no dia "@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " às "@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Esqueci a minha senha"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index ec1510a901..fe688cdba7 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Письмо для восстановления пароля отправлено на адрес "@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Указанный вами адрес электронной почты не связан ни с одной учетной записью пользователя."@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Следующий запрос вы сможете отправить "@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " в "@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Я забыл свой пароль"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 75cf97d9c6..cb3dee6da2 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -254,6 +254,46 @@ uil-data:reset_password_note.Vitro uil:hasKey "reset_password_note" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_email_sent.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Email za resetovanje lozinke je poslat na adresu "@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_email_non_existing.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Email koji ste uneli nije povezan ni sa jednim korisničkim nalogom."@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_non_existing" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Sledeći zahtev za resetovanje lozinke ćete moći da pošaljete dana "@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_too_many_requests_at_time.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label " u "@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests_at_time" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_label.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Zaboravio sam lozinku"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; From 5f2bdf33a942867a387d777d40de975894be2e11 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 6 Oct 2023 13:54:00 +0200 Subject: [PATCH 04/63] Refactored logic in order to not force user to change password upon logging in. --- .../user/UserAccountsResetPasswordPage.java | 3 ++ .../authenticate/ForgotPassword.java | 35 +++---------- .../PasswordChangeRequestSpamMitigation.java | 49 +++++++++++++++++++ ...rdChangeRequestSpamMitigationResponse.java | 46 +++++++++++++++++ 4 files changed, 106 insertions(+), 27 deletions(-) create mode 100644 api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java create mode 100644 api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java index 8e22ae0439..a638f1ad34 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.Map; +import edu.cornell.mannlib.vitro.webapp.controller.authenticate.PasswordChangeRequestSpamMitigation; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -40,6 +41,8 @@ public void resetPassword() { log.debug("Set password on '" + userAccount.getEmailAddress() + "' to '" + newPassword + "'"); + PasswordChangeRequestSpamMitigation + .requestSuccessfullyHandledAndUserPasswordUpdated(userAccount.getEmailAddress()); notifyUser(); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index b3fd1f6170..45bacd2904 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -4,7 +4,6 @@ import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; -import java.time.LocalDateTime; import java.util.Calendar; import java.util.Date; import java.util.HashMap; @@ -39,10 +38,6 @@ public class ForgotPassword extends VitroHttpServlet { private static final Log log = LogFactory.getLog(ForgotPassword.class.getName()); - private static final Map requestHistory = new HashMap<>(); - - private static final Map requestFrequency = new HashMap<>(); - @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { @@ -61,24 +56,20 @@ public void doPost(HttpServletRequest request, HttpServletResponse response) thr return; } - clearOrInitializeHistoryRequestData(userAccount); - - Integer numberOfSuccessiveRequests = requestFrequency.get(email); - LocalDateTime momentOfFirstRequest = requestHistory.get(email); - LocalDateTime nextRequestAvailableAt = momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * 10); - if (nextRequestAvailableAt.isAfter(LocalDateTime.now())) { - String[] dateTimeTokens = nextRequestAvailableAt.toString().split("T"); - String dateString = dateTimeTokens[0]; - String timeString = dateTimeTokens[1].split("\\.")[0]; + PasswordChangeRequestSpamMitigationResponse mitigationResponse = + PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(userAccount); + if (!mitigationResponse.getCanBeRequested()) { out.println( - "

" + i18n.text("password_reset_too_many_requests") + dateString + - i18n.text("password_reset_too_many_requests_at_time") + timeString + "

"); + "

" + i18n.text("password_reset_too_many_requests") + + mitigationResponse.getNextRequestAvailableAtDate() + + i18n.text("password_reset_too_many_requests_at_time") + + mitigationResponse.getNextRequestAvailableAtTime() + "

"); return; } requestPasswordChange(userAccount, userAccountsDao); notifyUser(userAccount, i18n, vreq); - requestFrequency.computeIfPresent(email, (key, value) -> ++value); + PasswordChangeRequestSpamMitigation.requestSuccessfullyHandledAndUserIsNotified(userAccount.getEmailAddress()); out.println("

" + i18n.text("password_reset_email_sent") + email + "

"); } @@ -117,19 +108,9 @@ private PrintWriter setupResponsePrintWriter(HttpServletResponse response) throw private void requestPasswordChange(UserAccount userAccount, UserAccountsDao userAccountsDao) { userAccount.setPasswordLinkExpires(figureExpirationDate().getTime()); userAccount.generateEmailKey(); - userAccount.setPasswordChangeRequired(true); userAccountsDao.updateUserAccount(userAccount); } - private void clearOrInitializeHistoryRequestData(UserAccount userAccount) { - if (userAccount.isPasswordChangeRequired()) { - requestHistory.putIfAbsent(userAccount.getEmailAddress(), LocalDateTime.now()); - } else { - requestHistory.put(userAccount.getEmailAddress(), LocalDateTime.now()); - requestFrequency.put(userAccount.getEmailAddress(), 0); - } - } - private UserAccount getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { UserAccountsDao userAccountsDao = getUserAccountsDao(request); if (userAccountsDao == null) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java new file mode 100644 index 0000000000..d9eba855c3 --- /dev/null +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -0,0 +1,49 @@ +package edu.cornell.mannlib.vitro.webapp.controller.authenticate; + +import java.time.LocalDateTime; +import java.util.HashMap; +import java.util.Map; + +import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; + +public class PasswordChangeRequestSpamMitigation { + + private static final Map requestHistory = new HashMap<>(); + + private static final Map requestFrequency = new HashMap<>(); + + private static void initializeHistoryRequestDataIfNotExists(String emailAddress) { + if (requestHistory.containsKey(emailAddress)) { + return; + } + + requestHistory.put(emailAddress, LocalDateTime.now()); + requestFrequency.put(emailAddress, 0); + } + + public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(UserAccount userAccount) { + initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); + + Integer numberOfSuccessiveRequests = requestFrequency.get(userAccount.getEmailAddress()); + LocalDateTime momentOfFirstRequest = requestHistory.get(userAccount.getEmailAddress()); + LocalDateTime nextRequestAvailableAt = momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * 10); + + if (nextRequestAvailableAt.isAfter(LocalDateTime.now())) { + String[] dateTimeTokens = nextRequestAvailableAt.toString().split("T"); + String dateString = dateTimeTokens[0]; + String timeString = dateTimeTokens[1].split("\\.")[0]; + return new PasswordChangeRequestSpamMitigationResponse(false, dateString, timeString); + } + + return new PasswordChangeRequestSpamMitigationResponse(true); + } + + public static void requestSuccessfullyHandledAndUserIsNotified(String email) { + requestFrequency.computeIfPresent(email, (key, value) -> ++value); + } + + public static void requestSuccessfullyHandledAndUserPasswordUpdated(String email) { + requestHistory.remove(email); + requestFrequency.remove(email); + } +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java new file mode 100644 index 0000000000..58025e8017 --- /dev/null +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java @@ -0,0 +1,46 @@ +package edu.cornell.mannlib.vitro.webapp.controller.authenticate; + +public class PasswordChangeRequestSpamMitigationResponse { + + private Boolean canBeRequested; + + private String nextRequestAvailableAtDate; + + private String nextRequestAvailableAtTime; + + + public PasswordChangeRequestSpamMitigationResponse(Boolean canBeRequested, String nextRequestAvailableAtDate, + String nextRequestAvailableAtTime) { + this.canBeRequested = canBeRequested; + this.nextRequestAvailableAtDate = nextRequestAvailableAtDate; + this.nextRequestAvailableAtTime = nextRequestAvailableAtTime; + } + + public PasswordChangeRequestSpamMitigationResponse(Boolean canBeRequested) { + this.canBeRequested = canBeRequested; + } + + public Boolean getCanBeRequested() { + return canBeRequested; + } + + public void setCanBeRequested(Boolean canBeRequested) { + this.canBeRequested = canBeRequested; + } + + public String getNextRequestAvailableAtDate() { + return nextRequestAvailableAtDate; + } + + public void setNextRequestAvailableAtDate(String nextRequestAvailableAtDate) { + this.nextRequestAvailableAtDate = nextRequestAvailableAtDate; + } + + public String getNextRequestAvailableAtTime() { + return nextRequestAvailableAtTime; + } + + public void setNextRequestAvailableAtTime(String nextRequestAvailableAtTime) { + this.nextRequestAvailableAtTime = nextRequestAvailableAtTime; + } +} From f3e4c90c235486c33fba56d34fc1b4d8bcf468a0 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 13 Oct 2023 14:42:20 +0200 Subject: [PATCH 05/63] Added generic app name loading in url. --- .../mannlib/vitro/webapp/web/widgets/LoginWidget.java | 8 ++++++++ .../webapp/templates/freemarker/widgets/widget-login.ftl | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java index bca4731b62..76c6d7b386 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java @@ -52,6 +52,7 @@ public String toString() { private static enum TemplateVariable { LOGIN_NAME("loginName"), FORM_ACTION("formAction"), + FORGOT_PASSWORD("forgotPassword"), INFO_MESSAGE("infoMessage"), ERROR_MESSAGE("errorMessage"), EXTERNAL_AUTH_NAME("externalAuthName"), @@ -134,6 +135,7 @@ private WidgetTemplateValues showLoginScreen(HttpServletRequest request, String WidgetTemplateValues values = new WidgetTemplateValues(Macro.LOGIN.toString()); values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request)); values.put(TemplateVariable.LOGIN_NAME.toString(), bean.getUsername()); + values.put(TemplateVariable.FORGOT_PASSWORD.toString(), getForgotPasswordUrl(request)); boolean showExternalAuth = StringUtils.isNotBlank( ConfigurationProperties.getBean(request).getProperty( @@ -232,4 +234,10 @@ private String getCancelUrl(HttpServletRequest request) { return contextPath + "/authenticate" + urlParams; } + /** What's the password recovery URL for this servlet? */ + private String getForgotPasswordUrl(HttpServletRequest request) { + String contextPath = request.getContextPath(); + return contextPath + "/forgot-password"; + } + } diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index b62b5bc225..eb4980adf1 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -73,7 +73,7 @@ -
+
From 74528fb9f12a189095933a27329132a105c32534 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 13 Oct 2023 15:48:51 +0200 Subject: [PATCH 06/63] Fixed wait time bug. --- .../PasswordChangeRequestSpamMitigation.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index d9eba855c3..31e8d1e1bc 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -12,21 +12,25 @@ public class PasswordChangeRequestSpamMitigation { private static final Map requestFrequency = new HashMap<>(); - private static void initializeHistoryRequestDataIfNotExists(String emailAddress) { + private static final long INTERVAL_INCREASE_MINUTES = 1; + + private static boolean initializeHistoryRequestDataIfNotExists(String emailAddress) { if (requestHistory.containsKey(emailAddress)) { - return; + return false; } requestHistory.put(emailAddress, LocalDateTime.now()); requestFrequency.put(emailAddress, 0); + return true; } public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(UserAccount userAccount) { - initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); + boolean justInitialised = initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); Integer numberOfSuccessiveRequests = requestFrequency.get(userAccount.getEmailAddress()); LocalDateTime momentOfFirstRequest = requestHistory.get(userAccount.getEmailAddress()); - LocalDateTime nextRequestAvailableAt = momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * 10); + LocalDateTime nextRequestAvailableAt = + momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * INTERVAL_INCREASE_MINUTES); if (nextRequestAvailableAt.isAfter(LocalDateTime.now())) { String[] dateTimeTokens = nextRequestAvailableAt.toString().split("T"); @@ -35,6 +39,10 @@ public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequest return new PasswordChangeRequestSpamMitigationResponse(false, dateString, timeString); } + if (numberOfSuccessiveRequests > 0) { + requestHistory.put(userAccount.getEmailAddress(), LocalDateTime.now()); + } + return new PasswordChangeRequestSpamMitigationResponse(true); } From fab43040883fa1d05ac4dce2a627e59e997a493b Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 24 Oct 2023 17:05:56 +0200 Subject: [PATCH 07/63] Link unavaliable after unsuccessfull login bug fix. --- .../main/webapp/templates/freemarker/widgets/widget-login.ftl | 1 + 1 file changed, 1 insertion(+) diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index eb4980adf1..60f54e4200 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -83,6 +83,7 @@ document.addEventListener('DOMContentLoaded', function() { const loginNameInput = document.getElementById('loginName'); const emailInput = document.getElementById('email'); + emailInput.value = loginNameInput.value; loginNameInput.addEventListener('input', function() { emailInput.value = loginNameInput.value; From 62bebccd87bf38c74b97f22d1957c3b4dda0c56e Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 27 Oct 2023 15:57:46 +0200 Subject: [PATCH 08/63] Remade message notifications to be inside VIVO context. --- .../authenticate/ForgotPassword.java | 30 ++++++++++--------- .../userAccounts-resetPasswordRequest.ftl | 5 ++++ 2 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index 45bacd2904..e79e8bd1f7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -16,9 +16,11 @@ import javax.servlet.http.HttpServletResponse; import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; -import edu.cornell.mannlib.vitro.webapp.controller.VitroHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.ResponseValues; +import edu.cornell.mannlib.vitro.webapp.controller.freemarker.responsevalues.TemplateResponseValues; import edu.cornell.mannlib.vitro.webapp.dao.UserAccountsDao; import edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory; import edu.cornell.mannlib.vitro.webapp.email.FreemarkerEmailFactory; @@ -30,48 +32,48 @@ import org.apache.commons.logging.LogFactory; @WebServlet(name = "forgot-password", urlPatterns = {"/forgot-password"}) -public class ForgotPassword extends VitroHttpServlet { +public class ForgotPassword extends FreemarkerHttpServlet { private static final String RESET_PASSWORD_URL = "/accounts/resetPassword"; private static final int DAYS_TO_USE_PASSWORD_LINK = 5; + private static final String TEMPLATE_NAME = "userAccounts-resetPasswordRequest.ftl"; + private static final Log log = LogFactory.getLog(ForgotPassword.class.getName()); @Override - public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException { - PrintWriter out = setupResponsePrintWriter(response); - log.info("Password reset requested from client: " + request.getRemoteAddr()); - - VitroRequest vreq = new VitroRequest(request); + protected ResponseValues processRequest(VitroRequest vreq) throws Exception { + Map dataContext = new HashMap(); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); - String email = request.getParameter("email"); + String email = vreq.getParameter("email"); - UserAccount userAccount = getAccountForInternalAuth(email, request); + UserAccount userAccount = getAccountForInternalAuth(email, vreq); if (userAccount == null) { - out.println("

" + i18n.text("password_reset_email_non_existing") + "

"); - return; + dataContext.put("message", i18n.text("password_reset_email_non_existing")); + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } PasswordChangeRequestSpamMitigationResponse mitigationResponse = PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(userAccount); if (!mitigationResponse.getCanBeRequested()) { - out.println( + dataContext.put("message", "

" + i18n.text("password_reset_too_many_requests") + mitigationResponse.getNextRequestAvailableAtDate() + i18n.text("password_reset_too_many_requests_at_time") + mitigationResponse.getNextRequestAvailableAtTime() + "

"); - return; + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } requestPasswordChange(userAccount, userAccountsDao); notifyUser(userAccount, i18n, vreq); PasswordChangeRequestSpamMitigation.requestSuccessfullyHandledAndUserIsNotified(userAccount.getEmailAddress()); - out.println("

" + i18n.text("password_reset_email_sent") + email + "

"); + dataContext.put("message", "

" + i18n.text("password_reset_email_sent") + email + "

"); + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } private void notifyUser(UserAccount userAccount, I18nBundle i18n, diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl new file mode 100644 index 0000000000..5ed2ddae53 --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -0,0 +1,5 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> + +<#-- Template for notifying user about reset password request state --> + +

${message}

From 8ec6dcb3eb38e18e81e842af279c271831b27c91 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 30 Oct 2023 16:30:31 +0100 Subject: [PATCH 09/63] Moved password change form to separate page. Updated translation files with required labels. --- .../authenticate/ForgotPassword.java | 24 +++++++-- .../PasswordChangeRequestSpamMitigation.java | 2 +- .../firsttime/vitro_UiLabel.ttl | 42 ++++++++++++++- .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 40 ++++++++++++++ .../userAccounts-resetPasswordRequest.ftl | 53 ++++++++++++++++++- .../freemarker/widgets/widget-login.ftl | 36 +++---------- 12 files changed, 402 insertions(+), 35 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index e79e8bd1f7..9a3be1423b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -45,10 +45,18 @@ public class ForgotPassword extends FreemarkerHttpServlet { @Override protected ResponseValues processRequest(VitroRequest vreq) throws Exception { - Map dataContext = new HashMap(); + Map dataContext = new HashMap<>(); + dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); + dataContext.put("contactUrl", getContactUrl(vreq)); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); + if (vreq.getMethod().equalsIgnoreCase("GET")) { + dataContext.put("showPasswordChangeForm", true); + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); + } + + dataContext.put("showPasswordChangeForm", false); String email = vreq.getParameter("email"); UserAccount userAccount = getAccountForInternalAuth(email, vreq); @@ -108,7 +116,7 @@ private PrintWriter setupResponsePrintWriter(HttpServletResponse response) throw } private void requestPasswordChange(UserAccount userAccount, UserAccountsDao userAccountsDao) { - userAccount.setPasswordLinkExpires(figureExpirationDate().getTime()); + userAccount.setPasswordLinkExpires(calculateExpirationDate().getTime()); userAccount.generateEmailKey(); userAccountsDao.updateUserAccount(userAccount); } @@ -147,9 +155,19 @@ private String buildResetPasswordLink(String email, String key, VitroRequest vre } } - private Date figureExpirationDate() { + private Date calculateExpirationDate() { Calendar c = Calendar.getInstance(); c.add(Calendar.DATE, DAYS_TO_USE_PASSWORD_LINK); return c.getTime(); } + + private String getForgotPasswordUrl(VitroRequest request) { + String contextPath = request.getContextPath(); + return contextPath + "/forgot-password"; + } + + private String getContactUrl(VitroRequest request) { + String contextPath = request.getContextPath(); + return contextPath + "/contact"; + } } \ No newline at end of file diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index 31e8d1e1bc..a8edb70989 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -12,7 +12,7 @@ public class PasswordChangeRequestSpamMitigation { private static final Map requestFrequency = new HashMap<>(); - private static final long INTERVAL_INCREASE_MINUTES = 1; + private static final long INTERVAL_INCREASE_MINUTES = 10; private static boolean initializeHistoryRequestDataIfNotExists(String emailAddress) { if (requestHistory.containsKey(emailAddress)) { diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index ac843a5572..d5cc6616d0 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -289,11 +289,51 @@ uil-data:password_reset_too_many_requests_at_time.Vitro uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "I forgot my password"@de-DE ; + rdfs:label "Ich habe mein Passwort vergessen"@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Passwort zurücksetzen"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Mein Passwort zurücksetzen"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Um Ihr Passwort zurückzusetzen, geben Sie bitte Ihre E-Mail-Adresse ein:"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Kontakt"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 9c7403d0b0..c62f707173 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Reset Password"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Reset my password"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "To reset your password, please enter your email address below:"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "If you don't remember your email, please"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contact us"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index fd84de921e..70aa0090c0 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Reset Password"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Reset my password"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "To reset your password, please enter your email address below:"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "If you don't remember your email, please"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contact us"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 3f10ee9b1a..803130ec7d 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Restablecer Contraseña"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Restablecer mi contraseña"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Para restablecer su contraseña, por favor ingrese su dirección de correo electrónico a continuación:"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Si no recuerda su dirección de correo electrónico, por favor"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contáctenos"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 5bced64f31..5cb28ccda8 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Réinitialiser le mot de passe"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Réinitialiser mon mot de passe"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Pour réinitialiser votre mot de passe, veuillez entrer votre adresse e-mail ci-dessous:"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Si vous ne vous souvenez pas de votre adresse e-mail, veuillez"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "nous contacter"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index 607e7b230f..4743e794b3 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Redefinir Senha"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Redefinir minha senha"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Para redefinir sua senha, por favor insira seu endereço de email abaixo:"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Se você não se lembra do seu email, por favor"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "entre em contato conosco"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index fe688cdba7..f3804f4cf8 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Сброс пароля"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Сбросить пароль"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Для сброса пароля, введите ваш адрес электронной почты:"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста,"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "свяжитесь с нами"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index cb3dee6da2..d2c7f89643 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -294,6 +294,46 @@ uil-data:password_reset_label.Vitro uil:hasKey "password_reset_label" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_title.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Resetovanje Lozinke"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_button.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Resetuj moju lozinku"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_manual.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Da resetujete lozinku, unesite vašu email adresu povezanu sa nalogom:"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "kontaktirate"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 5ed2ddae53..53aeaf4691 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -2,4 +2,55 @@ <#-- Template for notifying user about reset password request state --> -

${message}

+<#if showPasswordChangeForm == true> +

${i18n().password_reset_title}

+
+ +
+
+ + + +

+ +

+ +
+

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

+
+
+<#else> +

${message}

+ + + + diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index 60f54e4200..e227aac60d 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -61,7 +61,13 @@ -

+

+ +

+ +

+ ${i18n().password_reset_label} +

<#-- NC: remember me won't be ready for r1.2 @@ -73,34 +79,6 @@ -
- - -
- - - - - From d7852d128f7396d99ea76b8020350459aca3b419 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 31 Oct 2023 15:31:03 +0100 Subject: [PATCH 10/63] Removed contact us section. Cleaned up mitigation code. --- .../controller/authenticate/ForgotPassword.java | 6 ------ .../PasswordChangeRequestSpamMitigation.java | 8 ++++---- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 16 ---------------- .../userAccounts-resetPasswordRequest.ftl | 3 --- 11 files changed, 4 insertions(+), 141 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index 9a3be1423b..f081d2a56d 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -47,7 +47,6 @@ public class ForgotPassword extends FreemarkerHttpServlet { protected ResponseValues processRequest(VitroRequest vreq) throws Exception { Map dataContext = new HashMap<>(); dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); - dataContext.put("contactUrl", getContactUrl(vreq)); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); @@ -165,9 +164,4 @@ private String getForgotPasswordUrl(VitroRequest request) { String contextPath = request.getContextPath(); return contextPath + "/forgot-password"; } - - private String getContactUrl(VitroRequest request) { - String contextPath = request.getContextPath(); - return contextPath + "/contact"; - } } \ No newline at end of file diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index a8edb70989..8842eb60f7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -14,18 +14,18 @@ public class PasswordChangeRequestSpamMitigation { private static final long INTERVAL_INCREASE_MINUTES = 10; - private static boolean initializeHistoryRequestDataIfNotExists(String emailAddress) { + + private static void initializeHistoryRequestDataIfNotExists(String emailAddress) { if (requestHistory.containsKey(emailAddress)) { - return false; + return; } requestHistory.put(emailAddress, LocalDateTime.now()); requestFrequency.put(emailAddress, 0); - return true; } public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(UserAccount userAccount) { - boolean justInitialised = initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); + initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); Integer numberOfSuccessiveRequests = requestFrequency.get(userAccount.getEmailAddress()); LocalDateTime momentOfFirstRequest = requestHistory.get(userAccount.getEmailAddress()); diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index d5cc6616d0..66ea95a25c 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Kontakt"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index c62f707173..a2c8ba4c97 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "If you don't remember your email, please"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "contact us"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 70aa0090c0..84a2b8be2a 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "If you don't remember your email, please"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "contact us"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 803130ec7d..80f46b3e6f 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Si no recuerda su dirección de correo electrónico, por favor"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "contáctenos"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 5cb28ccda8..399d954829 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Si vous ne vous souvenez pas de votre adresse e-mail, veuillez"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "nous contacter"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index 4743e794b3..afa25016b8 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Se você não se lembra do seu email, por favor"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "entre em contato conosco"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index f3804f4cf8..9d5658a765 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста,"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "свяжитесь с нами"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index d2c7f89643..198ff0de9a 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,22 +318,6 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . - -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "kontaktirate"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 53aeaf4691..90b537e9af 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -14,9 +14,6 @@

- -
-

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

<#else> From 618c169554a72d568e8149b724251c35f3124846 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 31 Oct 2023 18:28:29 +0100 Subject: [PATCH 11/63] Added proper support page link, fixed information disclosure issue. --- .../authenticate/ForgotPassword.java | 63 ++++++++++++------- .../PasswordChangeRequestSpamMitigation.java | 10 +-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../firsttime/vitro_UiLabel.ttl | 24 +++++-- .../userAccounts-resetPasswordRequest.ftl | 3 + 11 files changed, 208 insertions(+), 60 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index f081d2a56d..32f4f50e78 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -1,19 +1,17 @@ package edu.cornell.mannlib.vitro.webapp.controller.authenticate; -import java.io.IOException; -import java.io.PrintWriter; import java.net.MalformedURLException; import java.net.URL; import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.Map; +import java.util.Random; import javax.mail.Message; import javax.servlet.ServletContext; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; @@ -45,8 +43,12 @@ public class ForgotPassword extends FreemarkerHttpServlet { @Override protected ResponseValues processRequest(VitroRequest vreq) throws Exception { + // Random time interval sleep so attacker can't calculate whether provided email is bound or not + sleepForRandomTime(); + Map dataContext = new HashMap<>(); dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); + dataContext.put("contactUrl", getContactUrl(vreq)); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); @@ -58,29 +60,24 @@ protected ResponseValues processRequest(VitroRequest vreq) throws Exception { dataContext.put("showPasswordChangeForm", false); String email = vreq.getParameter("email"); - UserAccount userAccount = getAccountForInternalAuth(email, vreq); - if (userAccount == null) { - dataContext.put("message", i18n.text("password_reset_email_non_existing")); - return new TemplateResponseValues(TEMPLATE_NAME, dataContext); - } - PasswordChangeRequestSpamMitigationResponse mitigationResponse = - PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(userAccount); + PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(email); if (!mitigationResponse.getCanBeRequested()) { dataContext.put("message", - "

" + i18n.text("password_reset_too_many_requests") + - mitigationResponse.getNextRequestAvailableAtDate() + + i18n.text("password_reset_too_many_requests") + mitigationResponse.getNextRequestAvailableAtDate() + i18n.text("password_reset_too_many_requests_at_time") + - mitigationResponse.getNextRequestAvailableAtTime() + "

"); + mitigationResponse.getNextRequestAvailableAtTime()); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } - requestPasswordChange(userAccount, userAccountsDao); - notifyUser(userAccount, i18n, vreq); - PasswordChangeRequestSpamMitigation.requestSuccessfullyHandledAndUserIsNotified(userAccount.getEmailAddress()); + UserAccount userAccount = getAccountForInternalAuth(email, vreq); + if (userAccount != null) { + requestPasswordChange(userAccount, userAccountsDao); + notifyUser(userAccount, i18n, vreq); + } - dataContext.put("message", "

" + i18n.text("password_reset_email_sent") + email + "

"); - return new TemplateResponseValues(TEMPLATE_NAME, dataContext); + PasswordChangeRequestSpamMitigation.requestSuccessfullyHandledAndUserIsNotified(email); + return emailSentMessage(dataContext, i18n, email); } private void notifyUser(UserAccount userAccount, I18nBundle i18n, @@ -103,17 +100,18 @@ private void notifyUser(UserAccount userAccount, I18nBundle i18n, emailMessage.send(); } + private ResponseValues emailSentMessage(Map dataContext, I18nBundle i18n, String email) { + dataContext.put("message", + i18n.text("password_reset_email_sent") + email + i18n.text("password_reset_email_sent_if_exists")); + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); + } + private UserAccountsDao constructUserAccountsDao(VitroRequest vreq) { ServletContext ctx = vreq.getSession().getServletContext(); WebappDaoFactory wdf = ModelAccess.on(ctx).getWebappDaoFactory(); return wdf.getUserAccountsDao(); } - private PrintWriter setupResponsePrintWriter(HttpServletResponse response) throws IOException { - response.setContentType("text/html"); - return response.getWriter(); - } - private void requestPasswordChange(UserAccount userAccount, UserAccountsDao userAccountsDao) { userAccount.setPasswordLinkExpires(calculateExpirationDate().getTime()); userAccount.generateEmailKey(); @@ -123,6 +121,7 @@ private void requestPasswordChange(UserAccount userAccount, UserAccountsDao user private UserAccount getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { UserAccountsDao userAccountsDao = getUserAccountsDao(request); if (userAccountsDao == null) { + log.info("User tried to reset password with an unbound email: " + emailAddress); return null; } return userAccountsDao.getUserAccountByEmail(emailAddress); @@ -164,4 +163,22 @@ private String getForgotPasswordUrl(VitroRequest request) { String contextPath = request.getContextPath(); return contextPath + "/forgot-password"; } + + private String getContactUrl(VitroRequest request) { + String contextPath = request.getContextPath(); + return contextPath + "/contact"; + } + + private void sleepForRandomTime() { + Random random = new Random(); + int minSleepTime = 100; + int maxSleepTime = 500; + int randomSleepTime = random.nextInt(maxSleepTime - minSleepTime + 1) + minSleepTime; + + try { + Thread.sleep(randomSleepTime); + } catch (InterruptedException e) { + log.error(randomSleepTime + "ms sleep time for mitigating time-based attacks was interrupted."); + } + } } \ No newline at end of file diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index 8842eb60f7..86b743d2f1 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -24,11 +24,11 @@ private static void initializeHistoryRequestDataIfNotExists(String emailAddress) requestFrequency.put(emailAddress, 0); } - public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(UserAccount userAccount) { - initializeHistoryRequestDataIfNotExists(userAccount.getEmailAddress()); + public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(String emailAddress) { + initializeHistoryRequestDataIfNotExists(emailAddress); - Integer numberOfSuccessiveRequests = requestFrequency.get(userAccount.getEmailAddress()); - LocalDateTime momentOfFirstRequest = requestHistory.get(userAccount.getEmailAddress()); + Integer numberOfSuccessiveRequests = requestFrequency.get(emailAddress); + LocalDateTime momentOfFirstRequest = requestHistory.get(emailAddress); LocalDateTime nextRequestAvailableAt = momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * INTERVAL_INCREASE_MINUTES); @@ -40,7 +40,7 @@ public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequest } if (numberOfSuccessiveRequests > 0) { - requestHistory.put(userAccount.getEmailAddress(), LocalDateTime.now()); + requestHistory.put(emailAddress, LocalDateTime.now()); } return new PasswordChangeRequestSpamMitigationResponse(true); diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 66ea95a25c..7e9fcded2f 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "E-Mail zur Passwortwiederherstellung gesendet an "@de-DE ; + rdfs:label "Eine E-Mail zur Wiederherstellung des Passworts wird an "@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Die von Ihnen angegebene E-Mail-Adresse ist keinem Benutzerkonto zugeordnet."@de-DE ; + rdfs:label " gesendet, wenn sie mit einem bestehenden Konto verknüpft ist."@de-DE ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Kontakt"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index a2c8ba4c97..ab518cc09d 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Password recovery email sent to "@en-CA ; + rdfs:label "Password recovery email is sent to "@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Email you have provided is not associated with any user account."@en-CA ; + rdfs:label ", if it is bound with an existing account."@en-CA ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "If you don't remember your email, please"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contact us"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 84a2b8be2a..9f9e2f380a 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Password recovery email sent to "@en-US ; + rdfs:label "Password recovery email is sent to "@en-US ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Email you have provided is not associated with any user account."@en-US ; + rdfs:label ", if it is bound with an existing account."@en-US ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "If you don't remember your email, please"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contact us"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 80f46b3e6f..ac6607ce9d 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Correo electrónico de recuperación de contraseña enviado a "@es ; + rdfs:label "Se envía un correo de recuperación de contraseña a "@es ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "El correo electrónico que ha proporcionado no está asociado con ninguna cuenta de usuario."@es ; + rdfs:label ", si está vinculado a una cuenta existente."@es ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Si no recuerda su dirección de correo electrónico, por favor"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "contáctenos"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 399d954829..88561b45ee 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "E-mail de récupération de mot de passe envoyé à "@fr-CA ; + rdfs:label "Un courriel de récupération de mot de passe est envoyé à "@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "L'e-mail que vous avez fourni n'est associé à aucun compte utilisateur."@fr-CA ; + rdfs:label ", s'il est lié à un compte existant."@fr-CA ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Si vous ne vous souvenez pas de votre adresse e-mail, veuillez"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "nous contacter"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index afa25016b8..b5d50f17eb 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "E-mail de recuperação de senha enviado para "@pt-BR ; + rdfs:label "Um e-mail de recuperação de senha é enviado para "@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "O e-mail que você forneceu não está associado a nenhuma conta de usuário."@pt-BR ; + rdfs:label ", se estiver vinculado a uma conta existente."@pt-BR ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Se você não se lembra do seu email, por favor"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "entre em contato conosco"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 9d5658a765..05474436b5 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Письмо для восстановления пароля отправлено на адрес "@ru-RU ; + rdfs:label "Письмо для восстановления пароля отправлено на "@ru-RU ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Указанный вами адрес электронной почты не связан ни с одной учетной записью пользователя."@ru-RU ; + rdfs:label ", если оно связано с существующим аккаунтом."@ru-RU ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста,"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "свяжитесь с нами"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 198ff0de9a..44a8dbc8e7 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,17 +257,17 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Email za resetovanje lozinke je poslat na adresu "@sr-Latn-RS ; + rdfs:label "Email za oporavak šifre je poslat na "@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_email_non_existing.Vitro +uil-data:password_reset_email_sent_if_exists.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Email koji ste uneli nije povezan ni sa jednim korisničkim nalogom."@sr-Latn-RS ; + rdfs:label ", ako je povezan sa postojećim nalogom."@sr-Latn-RS ; uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_non_existing" ; + uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro @@ -318,6 +318,22 @@ uil-data:password_reset_manual.Vitro uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . +uil-data:password_reset_forgot_email.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_forgot_email_contact_us.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "kontaktirate"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 90b537e9af..53aeaf4691 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -14,6 +14,9 @@

+ +
+

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

<#else> From 81f14d86d6d9740e4e59832b09a6bcb0cd3c15df Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 1 Nov 2023 15:12:01 +0100 Subject: [PATCH 12/63] Fixed codestyle violations. --- .../authenticate/PasswordChangeRequestSpamMitigation.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index 86b743d2f1..8fc412cc8f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -4,8 +4,6 @@ import java.util.HashMap; import java.util.Map; -import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; - public class PasswordChangeRequestSpamMitigation { private static final Map requestHistory = new HashMap<>(); From 054afd5de99daab2c1f0a228739d25ca63ac8edc Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 1 Nov 2023 17:30:00 +0100 Subject: [PATCH 13/63] Added captcha. --- .../authenticate/ForgotPassword.java | 25 +++++++++++-- .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../firsttime/vitro_UiLabel.ttl | 8 +++++ .../userAccounts-resetPasswordRequest.ftl | 35 ++++++++++++++++++- .../freemarker/edit/forms/css/customForm.css | 6 ++++ 11 files changed, 127 insertions(+), 3 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index 32f4f50e78..176ce64b33 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -49,12 +49,19 @@ protected ResponseValues processRequest(VitroRequest vreq) throws Exception { Map dataContext = new HashMap<>(); dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); dataContext.put("contactUrl", getContactUrl(vreq)); + dataContext.put("wrongCaptcha", false); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); if (vreq.getMethod().equalsIgnoreCase("GET")) { - dataContext.put("showPasswordChangeForm", true); - return new TemplateResponseValues(TEMPLATE_NAME, dataContext); + return showForm(dataContext); + } + + String captchaInput = vreq.getParameter("defaultReal"); + String captchaDisplay = vreq.getParameter("defaultRealHash"); + if (!captchaHash(captchaInput).equals(captchaDisplay)) { + dataContext.put("wrongCaptcha", true); + return showForm(dataContext); } dataContext.put("showPasswordChangeForm", false); @@ -100,12 +107,26 @@ private void notifyUser(UserAccount userAccount, I18nBundle i18n, emailMessage.send(); } + private String captchaHash(String value) { + int hash = 5381; + value = value.toUpperCase(); + for (int i = 0; i < value.length(); i++) { + hash = ((hash << 5) + hash) + value.charAt(i); + } + return String.valueOf(hash); + } + private ResponseValues emailSentMessage(Map dataContext, I18nBundle i18n, String email) { dataContext.put("message", i18n.text("password_reset_email_sent") + email + i18n.text("password_reset_email_sent_if_exists")); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } + private ResponseValues showForm(Map dataContext) { + dataContext.put("showPasswordChangeForm", true); + return new TemplateResponseValues(TEMPLATE_NAME, dataContext); + } + private UserAccountsDao constructUserAccountsDao(VitroRequest vreq) { ServletContext ctx = vreq.getSession().getServletContext(); WebappDaoFactory wdf = ModelAccess.on(ctx).getWebappDaoFactory(); diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 7e9fcded2f..f73e0cd3d9 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Falsches Captcha, versuchen Sie es erneut."@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index ab518cc09d..05a62e681d 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -334,6 +334,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Wrong captcha, try again."@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 9f9e2f380a..76a3352c02 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Wrong captcha, try again."@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index ac6607ce9d..06adb45ca2 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Captcha incorrecto, inténtelo de nuevo."@es ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 88561b45ee..50d03b4212 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Captcha incorrect, réessayez."@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index b5d50f17eb..afd36ca1e3 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Captcha incorreto, tente novamente."@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 05474436b5..330ba6bf27 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Неверная капча, попробуйте ещё раз."@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 44a8dbc8e7..30a83d793b 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -270,6 +270,14 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil:hasKey "password_reset_email_sent_if_exists" ; uil:hasPackage "Vitro-languages" . +uil-data:wrong_captcha.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Pogrešna captcha, pokušajte ponovo."sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "wrong_captcha" ; + uil:hasPackage "Vitro-languages" . + uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 53aeaf4691..f06d120182 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -11,9 +11,17 @@ +

+ + +

+

+ <#if wrongCaptcha == true> +

${i18n().wrong_captcha}

+

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

@@ -34,6 +42,7 @@ font-size: 16px; height: 1.5em; width: 20em; + margin-bottom: 2em; } .submit button.green { @@ -45,12 +54,36 @@ } a { - color: #0072b5; /* Adjust link color as needed */ + color: #0072b5; text-decoration: none; } h1 { font-size: 24px; } + + #defaultReal { + display: block; + margin-top: 1em; + margin-left: 0; + width: 246px; + } + + #forgotPasswordForm .errorMessage { + color: red; + background: #efefef; + padding: 1em; + } +${stylesheets.add('', + '')} +${scripts.add('', + '', + '')} + + diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css index fe05157bf5..00c60a1d6e 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css @@ -142,6 +142,12 @@ section#pubsContainer input { img#indicator { padding-left:60px; } + +/* ---------------------------------- */ +/* ------- FORGOT PASSWORD -------- */ +/* ------------------------------- */ + + /* for placeholder text */ ::-webkit-input-placeholder { /* WebKit browsers */ opacity: .25; From 767e8febe104257986bdb2552a2e775d2f21778f Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 2 Nov 2023 10:56:05 +0100 Subject: [PATCH 14/63] Fixed localization bug regarding Serbian labels. --- .../i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 30a83d793b..08dd200c6e 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,7 +273,7 @@ uil-data:password_reset_email_sent_if_exists.Vitro uil-data:wrong_captcha.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Pogrešna captcha, pokušajte ponovo."sr-Latn-RS ; + rdfs:label "Pogrešna captcha, pokušajte ponovo."@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "wrong_captcha" ; uil:hasPackage "Vitro-languages" . From 3a96b357c0b10e8865bc98a3bd5483aebc2bd988 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 3 Nov 2023 13:34:35 +0100 Subject: [PATCH 15/63] Added feature toggle. Fixed concurrency issues in SPAM mitigation class. --- .../authenticate/ForgotPassword.java | 25 ++- .../PasswordChangeRequestSpamMitigation.java | 16 +- .../vitro/webapp/web/widgets/LoginWidget.java | 199 +++++++++--------- .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../firsttime/vitro_UiLabel.ttl | 8 + .../userAccounts-resetPasswordRequest.ftl | 68 +++--- .../freemarker/widgets/widget-login.ftl | 8 +- 13 files changed, 235 insertions(+), 145 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java index 176ce64b33..5ed9c5a2f7 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPassword.java @@ -14,6 +14,7 @@ import javax.servlet.http.HttpServletRequest; import edu.cornell.mannlib.vitro.webapp.beans.UserAccount; +import edu.cornell.mannlib.vitro.webapp.config.ConfigurationProperties; import edu.cornell.mannlib.vitro.webapp.controller.VitroRequest; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.FreemarkerHttpServlet; import edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder; @@ -40,28 +41,32 @@ public class ForgotPassword extends FreemarkerHttpServlet { private static final Log log = LogFactory.getLog(ForgotPassword.class.getName()); - @Override protected ResponseValues processRequest(VitroRequest vreq) throws Exception { // Random time interval sleep so attacker can't calculate whether provided email is bound or not sleepForRandomTime(); Map dataContext = new HashMap<>(); - dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); - dataContext.put("contactUrl", getContactUrl(vreq)); - dataContext.put("wrongCaptcha", false); + setCommonValues(dataContext, vreq); UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); I18nBundle i18n = I18n.bundle(vreq); + boolean isEnabled = + Boolean.parseBoolean(ConfigurationProperties.getBean(vreq).getProperty("forgotPassword.isEnabled")); + dataContext.put("isEnabled", isEnabled); + if (!isEnabled) { + return showFormIfEnabled(dataContext); + } + if (vreq.getMethod().equalsIgnoreCase("GET")) { - return showForm(dataContext); + return showFormIfEnabled(dataContext); } String captchaInput = vreq.getParameter("defaultReal"); String captchaDisplay = vreq.getParameter("defaultRealHash"); if (!captchaHash(captchaInput).equals(captchaDisplay)) { dataContext.put("wrongCaptcha", true); - return showForm(dataContext); + return showFormIfEnabled(dataContext); } dataContext.put("showPasswordChangeForm", false); @@ -116,13 +121,19 @@ private String captchaHash(String value) { return String.valueOf(hash); } + private void setCommonValues(Map dataContext, VitroRequest vreq) { + dataContext.put("forgotPasswordUrl", getForgotPasswordUrl(vreq)); + dataContext.put("contactUrl", getContactUrl(vreq)); + dataContext.put("wrongCaptcha", false); + } + private ResponseValues emailSentMessage(Map dataContext, I18nBundle i18n, String email) { dataContext.put("message", i18n.text("password_reset_email_sent") + email + i18n.text("password_reset_email_sent_if_exists")); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } - private ResponseValues showForm(Map dataContext) { + private ResponseValues showFormIfEnabled(Map dataContext) { dataContext.put("showPasswordChangeForm", true); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index 8fc412cc8f..c3cbe7487f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -1,25 +1,21 @@ package edu.cornell.mannlib.vitro.webapp.controller.authenticate; import java.time.LocalDateTime; -import java.util.HashMap; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public class PasswordChangeRequestSpamMitigation { - private static final Map requestHistory = new HashMap<>(); + private static final Map requestHistory = new ConcurrentHashMap<>(); - private static final Map requestFrequency = new HashMap<>(); + private static final Map requestFrequency = new ConcurrentHashMap<>(); private static final long INTERVAL_INCREASE_MINUTES = 10; private static void initializeHistoryRequestDataIfNotExists(String emailAddress) { - if (requestHistory.containsKey(emailAddress)) { - return; - } - - requestHistory.put(emailAddress, LocalDateTime.now()); - requestFrequency.put(emailAddress, 0); + requestHistory.putIfAbsent(emailAddress, LocalDateTime.now()); + requestFrequency.putIfAbsent(emailAddress, 0); } public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(String emailAddress) { @@ -45,7 +41,7 @@ public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequest } public static void requestSuccessfullyHandledAndUserIsNotified(String email) { - requestFrequency.computeIfPresent(email, (key, value) -> ++value); + requestFrequency.merge(email, 1, Integer::sum); } public static void requestSuccessfullyHandledAndUserPasswordUpdated(String email) { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java index 76c6d7b386..b272e0b1b4 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java @@ -25,59 +25,16 @@ import freemarker.template.utility.DeepUnwrap; public class LoginWidget extends Widget { - private static final Log log = LogFactory.getLog(LoginWidget.class); + private static final Log log = LogFactory.getLog(LoginWidget.class); - /** The page that kicks off the External Authentication process. */ - private static final String EXTERNAL_AUTH_SETUP_URL = "/loginExternalAuth"; - - private static enum Macro { - LOGIN("loginForm"), - FORCE_PASSWORD_CHANGE("forcePasswordChange"), - ALREADY_LOGGED_IN("alreadyLoggedIn"), - SERVER_ERROR("error"); - - private final String macroName; - - Macro(String macroName) { - this.macroName = macroName; - } - - @Override - public String toString() { - return macroName; - } - - } - - private static enum TemplateVariable { - LOGIN_NAME("loginName"), - FORM_ACTION("formAction"), - FORGOT_PASSWORD("forgotPassword"), - INFO_MESSAGE("infoMessage"), - ERROR_MESSAGE("errorMessage"), - EXTERNAL_AUTH_NAME("externalAuthName"), - EXTERNAL_AUTH_URL("externalAuthUrl"), - CANCEL_URL("cancelUrl"), - SITE_NAME("siteName"), - MINIMUM_PASSWORD_LENGTH("minimumPasswordLength"), - MAXIMUM_PASSWORD_LENGTH("maximumPasswordLength"); - - private final String variableName; - - TemplateVariable(String variableName) { - this.variableName = variableName; - } - - @Override - public String toString() { - return variableName; - } - - } + /** + * The page that kicks off the External Authentication process. + */ + private static final String EXTERNAL_AUTH_SETUP_URL = "/loginExternalAuth"; @Override protected WidgetTemplateValues process(Environment env, Map params, - HttpServletRequest request, ServletContext context) { + HttpServletRequest request, ServletContext context) { WidgetTemplateValues values = null; @@ -89,21 +46,21 @@ protected WidgetTemplateValues process(Environment env, Map params, TemplateHashModel dataModel = env.getDataModel(); switch (state) { - case LOGGED_IN: - // On the login page itself, show a message that the user is already logged in. - // Otherwise, when redirecting to login page from a page that the logged-in user - // doesn't have access to, we would just show a blank page. - if (request.getServletPath().equals(Route.LOGIN.path())) { - values = showMessageToLoggedInUser(request); + case LOGGED_IN: + // On the login page itself, show a message that the user is already logged in. + // Otherwise, when redirecting to login page from a page that the logged-in user + // doesn't have access to, we would just show a blank page. + if (request.getServletPath().equals(Route.LOGIN.path())) { + values = showMessageToLoggedInUser(request); + break; + } else { + return null; + } + case FORCED_PASSWORD_CHANGE: + values = showPasswordChangeScreen(request); break; - } else { - return null; - } - case FORCED_PASSWORD_CHANGE: - values = showPasswordChangeScreen(request); - break; - default: - values = showLoginScreen(request, dataModel.get("siteName").toString()); + default: + values = showLoginScreen(request, dataModel.get("siteName").toString()); } values.put("urls", dataModel.get("urls")); @@ -111,7 +68,7 @@ protected WidgetTemplateValues process(Environment env, Map params, @SuppressWarnings("unchecked") Map dm = (Map) DeepUnwrap.permissiveUnwrap(dataModel); - User user = (User) dm.get("user"); + User user = (User) dm.get("user"); values.put("user", user); } catch (Exception e) { @@ -136,14 +93,16 @@ private WidgetTemplateValues showLoginScreen(HttpServletRequest request, String values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request)); values.put(TemplateVariable.LOGIN_NAME.toString(), bean.getUsername()); values.put(TemplateVariable.FORGOT_PASSWORD.toString(), getForgotPasswordUrl(request)); - - boolean showExternalAuth = StringUtils.isNotBlank( - ConfigurationProperties.getBean(request).getProperty( - "externalAuth.netIdHeaderName")); - if (showExternalAuth) { - values.put(TemplateVariable.EXTERNAL_AUTH_URL.toString(), - UrlBuilder.getUrl(EXTERNAL_AUTH_SETUP_URL)); - } + values.put(TemplateVariable.FORGOT_PASSWORD_ENABLED.toString(), + Boolean.parseBoolean(ConfigurationProperties.getBean(request).getProperty("forgotPassword.isEnabled"))); + + boolean showExternalAuth = StringUtils.isNotBlank( + ConfigurationProperties.getBean(request).getProperty( + "externalAuth.netIdHeaderName")); + if (showExternalAuth) { + values.put(TemplateVariable.EXTERNAL_AUTH_URL.toString(), + UrlBuilder.getUrl(EXTERNAL_AUTH_SETUP_URL)); + } String infoMessage = bean.getInfoMessageAndClear(); if (!infoMessage.isEmpty()) { @@ -172,7 +131,7 @@ private WidgetTemplateValues showPasswordChangeScreen(HttpServletRequest request log.trace("Going to password change screen: " + bean); WidgetTemplateValues values = new WidgetTemplateValues( - Macro.FORCE_PASSWORD_CHANGE.toString()); + Macro.FORCE_PASSWORD_CHANGE.toString()); values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request)); values.put(TemplateVariable.CANCEL_URL.toString(), getCancelUrl(request)); values.put(TemplateVariable.MINIMUM_PASSWORD_LENGTH.toString(), UserAccount.MIN_PASSWORD_LENGTH); @@ -187,7 +146,7 @@ private WidgetTemplateValues showPasswordChangeScreen(HttpServletRequest request private WidgetTemplateValues showError(Exception e) { WidgetTemplateValues values = new WidgetTemplateValues( - Macro.SERVER_ERROR.toString()); + Macro.SERVER_ERROR.toString()); values.put(TemplateVariable.ERROR_MESSAGE.toString(), "Internal server error:
" + e); return values; } @@ -200,44 +159,96 @@ private State getCurrentLoginState(HttpServletRequest request) { return State.LOGGED_IN; } if (isOutdatedLoginProcessBean(request)) { - LoginProcessBean.removeBean(request); + LoginProcessBean.removeBean(request); } return LoginProcessBean.getBean(request).getState(); } - /** - * A LoginProcessBean is outdated unless the the "in-process" flag is set in the - * session. - * - * Each time we hit Authenticate, the flag is set, and each time - * we draw the widget it is reset. - */ - private boolean isOutdatedLoginProcessBean(HttpServletRequest request) { - boolean inProcess = LoginInProcessFlag.checkAndReset(request); - if (!inProcess) { - log.debug("The process bean is outdated. Discard it."); - } - - return !inProcess; - } - - /** What's the URL for this servlet? */ + /** + * A LoginProcessBean is outdated unless the the "in-process" flag is set in the + * session. + *

+ * Each time we hit Authenticate, the flag is set, and each time + * we draw the widget it is reset. + */ + private boolean isOutdatedLoginProcessBean(HttpServletRequest request) { + boolean inProcess = LoginInProcessFlag.checkAndReset(request); + if (!inProcess) { + log.debug("The process bean is outdated. Discard it."); + } + + return !inProcess; + } + + /** + * What's the URL for this servlet? + */ private String getAuthenticateUrl(HttpServletRequest request) { String contextPath = request.getContextPath(); return contextPath + "/authenticate"; } - /** What's the URL for this servlet, with the cancel parameter added? */ + /** + * What's the URL for this servlet, with the cancel parameter added? + */ private String getCancelUrl(HttpServletRequest request) { String contextPath = request.getContextPath(); String urlParams = "?cancel=true"; return contextPath + "/authenticate" + urlParams; } - /** What's the password recovery URL for this servlet? */ + /** + * What's the password recovery URL for this servlet? + */ private String getForgotPasswordUrl(HttpServletRequest request) { String contextPath = request.getContextPath(); return contextPath + "/forgot-password"; } + private enum Macro { + LOGIN("loginForm"), + FORCE_PASSWORD_CHANGE("forcePasswordChange"), + ALREADY_LOGGED_IN("alreadyLoggedIn"), + SERVER_ERROR("error"); + + private final String macroName; + + Macro(String macroName) { + this.macroName = macroName; + } + + @Override + public String toString() { + return macroName; + } + + } + + private enum TemplateVariable { + LOGIN_NAME("loginName"), + FORM_ACTION("formAction"), + FORGOT_PASSWORD("forgotPassword"), + FORGOT_PASSWORD_ENABLED("forgotPasswordEnabled"), + INFO_MESSAGE("infoMessage"), + ERROR_MESSAGE("errorMessage"), + EXTERNAL_AUTH_NAME("externalAuthName"), + EXTERNAL_AUTH_URL("externalAuthUrl"), + CANCEL_URL("cancelUrl"), + SITE_NAME("siteName"), + MINIMUM_PASSWORD_LENGTH("minimumPasswordLength"), + MAXIMUM_PASSWORD_LENGTH("maximumPasswordLength"); + + private final String variableName; + + TemplateVariable(String variableName) { + this.variableName = variableName; + } + + @Override + public String toString() { + return variableName; + } + + } + } diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index f73e0cd3d9..b5994dd686 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Funktionalität deaktiviert durch den Website-Administrator"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 05a62e681d..16a20d1a9e 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:wrong_captcha.Vitro uil:hasKey "wrong_captcha" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Functionality disabled by site admin"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 76a3352c02..264a6101dd 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Functionality disabled by site admin"@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 06adb45ca2..80bcf117a8 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Funcionalidad desactivada por el administrador del sitio"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 50d03b4212..d21147821c 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Fonctionnalité désactivée par l'administrateur du site"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index afd36ca1e3..7158c304c5 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Funcionalidade desativada pelo administrador do site"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 330ba6bf27..ed91f647c6 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Функциональность отключена администратором сайта"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 08dd200c6e..3081f6c463 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -342,6 +342,14 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . +uil-data:functionality_disabled.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Funkcionalnost onemogućena od strane administratora sajta"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . + uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index f06d120182..7221a09606 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -2,33 +2,37 @@ <#-- Template for notifying user about reset password request state --> -<#if showPasswordChangeForm == true> -

${i18n().password_reset_title}

-
- -
-
- - - -

- - -

- -

- -

- <#if wrongCaptcha == true> -

${i18n().wrong_captcha}

- - -
-

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

-
-
+<#if isEnabled == true> + <#if showPasswordChangeForm == true> +

${i18n().password_reset_title}

+
+ +
+
+ + + +

+ + +

+ +

+ +

+ <#if wrongCaptcha == true> +

${i18n().wrong_captcha}

+ + +
+

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

+
+
+ <#else> +

${message}

+ <#else> -

${message}

+

${i18n().functionality_disabled} 😉.

-${stylesheets.add('', - '')} +${stylesheets.add('')} ${scripts.add('', - '', '')} -<#if isEnabled == true> - + +<#elseif captchaToUse == "NANOCAPTCHA"> + diff --git a/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl b/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl index 34ab812df0..553a6cd403 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl @@ -40,7 +40,6 @@
<#elseif captchaToUse == "NANOCAPTCHA"> -

@@ -67,8 +66,7 @@ }; -${stylesheets.add('', - '')} +${stylesheets.add('')} ${scripts.add('', '')} diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index b22bcfcfdc..41164d961f 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -67,7 +67,7 @@ <#if forgotPasswordEnabled == true>

- ${i18n().password_reset_label} + ${i18n().password_reset_label}

From 0526d50f28a652af51ff927de8b4973191f3acbe Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 16 Jan 2024 15:48:10 +0100 Subject: [PATCH 41/63] Improved localization. --- .../authenticate/ForgotPasswordController.java | 5 ++--- .../de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../en_US/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../es/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl | 12 ++---------- .../ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- 9 files changed, 11 insertions(+), 76 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 8d3062e7f2..7fd3cbbbf3 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -94,9 +94,8 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(email); if (!mitigationResponse.getCanBeRequested()) { dataContext.put("message", - i18n.text("password_reset_too_many_requests") + mitigationResponse.getNextRequestAvailableAtDate() + - i18n.text("password_reset_too_many_requests_at_time") + - mitigationResponse.getNextRequestAvailableAtTime()); + i18n.text("password_reset_too_many_requests", mitigationResponse.getNextRequestAvailableAtDate(), + mitigationResponse.getNextRequestAvailableAtTime())); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 968bcbc33f..adb9fcd57b 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Die nächste Anfrage können Sie am "@de-DE ; + rdfs:label "Die nächste Anfrage können Sie am {0} um {1}."@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " um "@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 4f3f42add2..3515076e6e 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -265,19 +265,11 @@ uil-data:password_reset_email_sent.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "You will be able to send the next request on "@en-CA ; + rdfs:label "You will be able to send the next request on {0} at {1}."@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " at "@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 195140de90..282edd8a33 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "You will be able to send the next request on "@en-US ; + rdfs:label "You will be able to send the next request on {0} at {1}."@en-US ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " at "@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index ccdcafc572..6d1485ee4b 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Podrás enviar una nueva petición el "@es ; + rdfs:label "Podrás enviar una nueva petición el {0} a las {1}."@es ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " a las "@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 26c824d9cf..9c005c7afb 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Vous pourrez envoyer la prochaine demande le "@fr-CA ; + rdfs:label "Vous pourrez envoyer la prochaine demande le {0} à {1}."@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " à "@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index e3e0afd77f..cf0bb5bbd0 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,7 +257,7 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Um e-mail de recuperação de senha será enviado para {0}, se esse estiver vinculado a uma conta existente."@pt-BR ; + rdfs:label "Um e-mail de recuperação de senha será enviado para a conta {0} se essa estiver vinculado a uma conta existente."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Você poderá enviar a próxima solicitação no dia "@pt-BR ; + rdfs:label "Você poderá enviar a próxima solicitação no dia {0} às {1}."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " às "@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 76971be032..04e0c840be 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Следующий запрос вы сможете отправить "@ru-RU ; + rdfs:label "Следующий запрос вы сможете отправить {0} в {1}."@ru-RU ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " в "@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 594ce6d05d..e1b6a6e597 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -273,19 +273,11 @@ uil-data:wrong_captcha.Vitro uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Sledeći zahtev za resetovanje lozinke ćete moći da pošaljete dana "@sr-Latn-RS ; + rdfs:label "Sledeći zahtev za resetovanje lozinke ćete moći da pošaljete dana {0} u {1}."@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_too_many_requests" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests_at_time.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label " u "@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests_at_time" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; From 3c3ce6862ec94fd3246b1b14250903093d45ba2d Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 26 Jan 2024 11:57:12 +0100 Subject: [PATCH 42/63] Addressed renaming and refactoring comments. Improved localization. --- .../user/UserAccountsResetPasswordPage.java | 2 +- .../ForgotPasswordController.java | 62 +++++++++---------- .../PasswordChangeRequestSpamMitigation.java | 12 ++-- .../vitro/webapp/web/widgets/LoginWidget.java | 4 +- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../firsttime/vitro_UiLabel.ttl | 18 +++--- .../userAccounts-resetPasswordRequest.ftl | 42 +------------ .../captcha/captcha-clientExecutionLogic.ftl | 39 ++++++++++++ .../body/contactForm/contactForm-form.ftl | 40 +----------- .../freemarker/edit/forms/css/customForm.css | 5 -- .../freemarker/widgets/widget-login.ftl | 9 ++- 17 files changed, 161 insertions(+), 198 deletions(-) create mode 100644 webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java index a638f1ad34..5e555f527c 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java @@ -42,7 +42,7 @@ public void resetPassword() { + "' to '" + newPassword + "'"); PasswordChangeRequestSpamMitigation - .requestSuccessfullyHandledAndUserPasswordUpdated(userAccount.getEmailAddress()); + .removeRequestHistoryAndFrequencyData(userAccount.getEmailAddress()); notifyUser(); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 7fd3cbbbf3..c6ecab622b 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -11,7 +11,6 @@ import java.util.Random; import javax.mail.Message; -import javax.servlet.ServletContext; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServletRequest; @@ -36,7 +35,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -@WebServlet(name = "forgot-password", urlPatterns = {"/forgot-password"}) +@WebServlet(name = "forgotPassword", urlPatterns = {"/forgotPassword"}) public class ForgotPasswordController extends FreemarkerHttpServlet { private static final String RESET_PASSWORD_URL = "/accounts/resetPassword"; @@ -77,10 +76,10 @@ protected ResponseValues processRequest(VitroRequest vreq) throws Exception { * @return A response containing the appropriate values for rendering the result. */ private ResponseValues handlePostRequest(VitroRequest vreq, Map dataContext) { - UserAccountsDao userAccountsDao = constructUserAccountsDao(vreq); + UserAccountsDao userAccountsDao = constructUserAccountsDao(); I18nBundle i18n = I18n.bundle(vreq); - String email = vreq.getParameter("email"); + String email = getNonNullTrimmedParameterValue(vreq, "email"); if (!captchaIsValid(vreq)) { dataContext.put("wrongCaptcha", true); @@ -91,7 +90,7 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map dataContext.put("showPasswordChangeForm", false); PasswordChangeRequestSpamMitigationResponse mitigationResponse = - PasswordChangeRequestSpamMitigation.isPasswordResetRequestable(email); + PasswordChangeRequestSpamMitigation.checkPasswordResetRequestAllowed(email); if (!mitigationResponse.getCanBeRequested()) { dataContext.put("message", i18n.text("password_reset_too_many_requests", mitigationResponse.getNextRequestAvailableAtDate(), @@ -99,7 +98,7 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } - Optional userAccountOptional = getAccountForInternalAuth(email, vreq); + Optional userAccountOptional = getAccountForInternalAuth(email); if (userAccountOptional.isPresent()) { requestPasswordChange(userAccountOptional.get(), userAccountsDao); notifyUser(userAccountOptional.get(), i18n, vreq); @@ -107,8 +106,8 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map log.info("User tried to reset password with an unassociated email: " + email); } - PasswordChangeRequestSpamMitigation.requestSuccessfullyHandledAndUserIsNotified(email); - return emailSentMessage(dataContext, i18n, email); + PasswordChangeRequestSpamMitigation.updateRequestHandlingAndNotifyUserIfExists(email); + return emailSentNotification(dataContext, i18n, email); } /** @@ -126,13 +125,13 @@ private boolean captchaIsValid(VitroRequest vreq) { String challengeId; switch (captchaImpl) { case RECAPTCHAV2: - captchaInput = nonNullAndTrim(vreq, "g-recaptcha-response"); + captchaInput = getNonNullTrimmedParameterValue(vreq, "g-recaptcha-response"); challengeId = ""; break; case NANOCAPTCHA: default: - captchaInput = nonNullAndTrim(vreq, "userSolution"); - challengeId = nonNullAndTrim(vreq, "challengeId"); + captchaInput = getNonNullTrimmedParameterValue(vreq, "userSolution"); + challengeId = getNonNullTrimmedParameterValue(vreq, "challengeId"); } return CaptchaServiceBean.validateCaptcha(captchaInput, challengeId); @@ -208,7 +207,7 @@ private boolean adminShouldBeNotified() { String adminShouldBeNotified = ConfigurationProperties.getInstance().getProperty("authentication.forgotPassword.notify-admin"); - return Objects.nonNull(adminShouldBeNotified) && Boolean.parseBoolean(adminShouldBeNotified); + return Boolean.parseBoolean(adminShouldBeNotified); } /** @@ -237,7 +236,7 @@ private void setCommonValues(Map dataContext, VitroRequest vreq) * @param email The email address to which the notification was sent. * @return A ResponseValues object containing the email sent message. */ - private ResponseValues emailSentMessage(Map dataContext, I18nBundle i18n, String email) { + private ResponseValues emailSentNotification(Map dataContext, I18nBundle i18n, String email) { dataContext.put("message", i18n.text("password_reset_email_sent", email)); return new TemplateResponseValues(TEMPLATE_NAME, dataContext); } @@ -256,12 +255,10 @@ private ResponseValues showForm(Map dataContext) { /** * Constructs a UserAccountsDao using the provided VitroRequest. * - * @param vreq The VitroRequest object for database access. * @return A UserAccountsDao instance for user account operations. */ - private UserAccountsDao constructUserAccountsDao(VitroRequest vreq) { - ServletContext ctx = vreq.getSession().getServletContext(); - WebappDaoFactory wdf = ModelAccess.on(ctx).getWebappDaoFactory(); + private UserAccountsDao constructUserAccountsDao() { + WebappDaoFactory wdf = ModelAccess.getInstance().getWebappDaoFactory(); return wdf.getUserAccountsDao(); } @@ -281,12 +278,11 @@ private void requestPasswordChange(UserAccount userAccount, UserAccountsDao user * Retrieves a user account for internal authentication based on the provided email address. * * @param emailAddress The email address associated with the user account. - * @param request The HttpServletRequest containing the context information. * @return An Optional containing the user account if found, * or empty if not found or if the UserAccountsDao is null. */ - private Optional getAccountForInternalAuth(String emailAddress, HttpServletRequest request) { - UserAccountsDao userAccountsDao = getUserAccountsDao(request); + private Optional getAccountForInternalAuth(String emailAddress) { + UserAccountsDao userAccountsDao = getUserAccountsDao(); if (userAccountsDao == null) { return Optional.empty(); } @@ -297,11 +293,10 @@ private Optional getAccountForInternalAuth(String emailAddress, Htt /** * Retrieves a UserAccountsDao instance from the provided HttpServletRequest. * - * @param request The HttpServletRequest for accessing the UserAccountsDao. * @return A UserAccountsDao instance for user account operations. */ - private UserAccountsDao getUserAccountsDao(HttpServletRequest request) { - UserAccountsDao userAccountsDao = getWebappDaoFactory(request) + private UserAccountsDao getUserAccountsDao() { + UserAccountsDao userAccountsDao = getWebappDaoFactory() .getUserAccountsDao(); if (userAccountsDao == null) { log.error("getUserAccountsDao: no UserAccountsDao"); @@ -313,11 +308,10 @@ private UserAccountsDao getUserAccountsDao(HttpServletRequest request) { /** * Retrieves a WebappDaoFactory instance from the provided HttpServletRequest. * - * @param request The HttpServletRequest for accessing the WebappDaoFactory. * @return A WebappDaoFactory instance for database access. */ - private WebappDaoFactory getWebappDaoFactory(HttpServletRequest request) { - return ModelAccess.on(request).getWebappDaoFactory(); + private WebappDaoFactory getWebappDaoFactory() { + return ModelAccess.getInstance().getWebappDaoFactory(); } /** @@ -359,7 +353,7 @@ private Date calculateExpirationDate() { */ private String getForgotPasswordUrl(VitroRequest request) { String contextPath = request.getContextPath(); - return contextPath + "/forgot-password"; + return contextPath + "/forgotPassword"; } /** @@ -400,17 +394,17 @@ private void sleepForRandomTime() { } /** - * Retrieves the value of the specified request parameter and ensures it is non-null. + * Retrieves the non-null and trimmed value of the specified request parameter. * If the parameter value is null, an empty string is returned. * Leading and trailing whitespace is removed from the parameter value. * - * @param req the HttpServletRequest containing the parameters - * @param key the key of the parameter to retrieve + * @param request the HttpServletRequest containing the parameters + * @param parameterKey the key of the parameter to retrieve * @return the non-null and trimmed value of the specified request parameter, * or an empty string if the parameter is null */ - private String nonNullAndTrim(HttpServletRequest req, String key) { - String value = req.getParameter(key); - return (value == null) ? "" : value.trim(); + private String getNonNullTrimmedParameterValue(HttpServletRequest request, String parameterKey) { + String parameterValue = request.getParameter(parameterKey); + return (parameterValue == null) ? "" : parameterValue.trim(); } -} \ No newline at end of file +} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java index 924b81b6fe..76212c7277 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java @@ -24,12 +24,12 @@ private static void initializeHistoryRequestDataIfNotExists(String emailAddress) } /** - * Determines whether a password reset request is allowed based on spam mitigation criteria. + * Checks whether a password reset request is allowed based on spam mitigation criteria. * * @param emailAddress The email address associated with the password reset request. * @return A PasswordChangeRequestSpamMitigationResponse indicating if the request is allowed. */ - public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequestable(String emailAddress) { + public static PasswordChangeRequestSpamMitigationResponse checkPasswordResetRequestAllowed(String emailAddress) { initializeHistoryRequestDataIfNotExists(emailAddress); Integer numberOfSuccessiveRequests = requestFrequency.get(emailAddress); @@ -55,10 +55,10 @@ public static PasswordChangeRequestSpamMitigationResponse isPasswordResetRequest * Updates request frequency and timestamp when a password reset request is successfully handled, * and the user is notified. * - * @param email The email address for which the request was successfully handled. + * @param emailAddress The email address for which the request was successfully handled. */ - public static void requestSuccessfullyHandledAndUserIsNotified(String email) { - requestFrequency.merge(email, 1, Integer::sum); + public static void updateRequestHandlingAndNotifyUserIfExists(String emailAddress) { + requestFrequency.merge(emailAddress, 1, Integer::sum); } @@ -68,7 +68,7 @@ public static void requestSuccessfullyHandledAndUserIsNotified(String email) { * * @param email The email address for which the request was successfully handled. */ - public static void requestSuccessfullyHandledAndUserPasswordUpdated(String email) { + public static void removeRequestHistoryAndFrequencyData(String email) { requestHistory.remove(email); requestFrequency.remove(email); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java index a5621f09b2..67eb04423f 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java @@ -93,7 +93,7 @@ private WidgetTemplateValues showLoginScreen(HttpServletRequest request, String String forgotPasswordEnabled = ConfigurationProperties.getInstance() .getProperty("authentication.forgotPassword"); - if (!Objects.nonNull(forgotPasswordEnabled)) { + if (forgotPasswordEnabled == null) { forgotPasswordEnabled = "disabled"; } @@ -210,7 +210,7 @@ private String getCancelUrl(HttpServletRequest request) { */ private String getForgotPasswordUrl(HttpServletRequest request) { String contextPath = request.getContextPath(); - return contextPath + "/forgot-password"; + return contextPath + "/forgotPassword"; } private enum Macro { diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index adb9fcd57b..b2a9658c00 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Die eingegebenen Buchstaben stimmen nicht mit denen im Sicherheitsfeld überein. Bitte versuchen Sie es erneut."@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Funktionalität deaktiviert durch den Website-Administrator"@de-DE ; + rdfs:label "Funktionalität deaktiviert durch den Website-Administrator."@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Seite aktualisieren, wenn nicht angezeigt..."@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 3515076e6e..91c19842d4 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -318,18 +318,10 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil:hasKey "password_reset_forgot_email_contact_us" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "The letters you have entered do not match what is shown in the security field. Please try again."@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Functionality disabled by site admin"@en-CA ; + rdfs:label "Functionality disabled by site admin."@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6413,3 +6405,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Refresh page if not displayed..."@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 282edd8a33..e8a20a90f1 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "The letters you have entered do not match what is shown in the security field. Please try again."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Functionality disabled by site admin"@en-US ; + rdfs:label "Functionality disabled by site admin."@en-US ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6413,3 +6405,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Refresh page if not displayed..."@en-US ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 6d1485ee4b..d1172d63d6 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Las letras introducidas no coinciden con las mostradas en el campo de seguridad. Vuelve a intentarlo."@es ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Funcionalidad desactivada por el administrador del sitio"@es ; + rdfs:label "Funcionalidad desactivada por el administrador del sitio."@es ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Actualizar la página si no se muestra..."@es ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 9c005c7afb..e47a0e32f6 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Les lettres que vous avez saisies ne correspondent pas à celles affichées dans le champ de sécurité. Veuillez réessayer."@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Fonctionnalité désactivée par l'administrateur du site"@fr-CA ; + rdfs:label "Fonctionnalité désactivée par l'administrateur du site."@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Actualiser la page si elle n'est pas affichée..."@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index cf0bb5bbd0..ce166d78d7 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "As letras que você digitou não correspondem ao que está mostrado na figura de verificação. Por favor, tente novamente."@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Funcionalidade desativada pelo administrador do site"@pt-BR ; + rdfs:label "Funcionalidade desativada pelo administrador do site."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Atualizar página se não estiver sendo exibida..."@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 04e0c840be..10f6c1560e 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Введенные символы не совпали с отображенными в поле безопасности. Пожалуйста, попробуйте еще раз."@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Функциональность отключена администратором сайта"@ru-RU ; + rdfs:label "Функциональность отключена администратором сайта."@ru-RU ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Обновите страницу, если не отображается..."@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index e1b6a6e597..69020c6ce5 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:wrong_captcha.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Slova koja ste uneli ne poklapaju se sa onima koja su prikazana u bezbednosnom polju. Molimo vas da pokušate ponovo."@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "wrong_captcha" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -329,7 +321,7 @@ uil-data:password_reset_forgot_email_contact_us.Vitro uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Funkcionalnost onemogućena od strane administratora sajta"@sr-Latn-RS ; + rdfs:label "Funkcionalnost onemogućena od strane administratora sajta."@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "functionality_disabled" ; uil:hasPackage "Vitro-languages" . @@ -6389,3 +6381,11 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . + +uil-data:captcha_not_displayed.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Osvežite stranicu ako se ne prikazuje..."@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "captcha_not_displayed" ; + uil:hasPackage "Vitro-languages" . diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index a4102f8e44..4c7bd0cd9f 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -20,7 +20,7 @@
- Refresh page if not displayed... + ${i18n().captcha_not_displayed}

@@ -45,7 +45,7 @@

${message}

<#else> -

${i18n().functionality_disabled} 😉.

+

${i18n().functionality_disabled}

-${stylesheets.add('')} -${scripts.add('', - '')} - -<#if isEnabled && captchaToUse == "RECAPTCHAV2"> - - -<#elseif captchaToUse == "NANOCAPTCHA"> - - +<#include "webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl"> diff --git a/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl new file mode 100644 index 0000000000..330d721f2f --- /dev/null +++ b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl @@ -0,0 +1,39 @@ +<#assign isEnabled = isEnabled!true> + +${stylesheets.add('')} +${scripts.add('', + '')} + +<#if isEnabled && captchaToUse == "RECAPTCHAV2"> + + +<#elseif isEnabled && captchaToUse == "NANOCAPTCHA"> + + diff --git a/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl b/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl index 553a6cd403..8f4ae56351 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/contactForm/contactForm-form.ftl @@ -44,7 +44,7 @@
- Refresh page if not displayed... + ${i18n().captcha_not_displayed}

@@ -66,40 +66,4 @@ }; -${stylesheets.add('')} -${scripts.add('', - '')} - -<#if captchaToUse == "RECAPTCHAV2"> - - -<#elseif captchaToUse == "NANOCAPTCHA"> - - +<#include "webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl"> diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css index 86b3b36c91..c5535cef49 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css @@ -165,11 +165,6 @@ img#indicator { padding-left:60px; } -/* ---------------------------------- */ -/* ------- FORGOT PASSWORD -------- */ -/* ------------------------------- */ - - /* for placeholder text */ ::-webkit-input-placeholder { /* WebKit browsers */ opacity: .25; diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index 41164d961f..f52371b815 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -67,7 +67,7 @@ <#if forgotPasswordEnabled == true>

- ${i18n().password_reset_label} + ${i18n().password_reset_label}

@@ -82,6 +82,13 @@ + + <#macro forcePasswordChange> From 6b771c77427ef32b576aeb23ad516e7aa1a54910 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 9 Feb 2024 14:26:26 +0100 Subject: [PATCH 43/63] Removed spam mitigation, changed default settings to disabled. --- .../user/UserAccountsResetPasswordPage.java | 4 - .../ForgotPasswordController.java | 10 --- .../PasswordChangeRequestSpamMitigation.java | 75 ------------------- ...rdChangeRequestSpamMitigationResponse.java | 46 ------------ .../config/example.runtime.properties | 4 +- 5 files changed, 2 insertions(+), 137 deletions(-) delete mode 100644 api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java delete mode 100644 api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java index 5e555f527c..4440e72af2 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/accounts/user/UserAccountsResetPasswordPage.java @@ -6,8 +6,6 @@ import java.util.HashMap; import java.util.Map; - -import edu.cornell.mannlib.vitro.webapp.controller.authenticate.PasswordChangeRequestSpamMitigation; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -41,8 +39,6 @@ public void resetPassword() { log.debug("Set password on '" + userAccount.getEmailAddress() + "' to '" + newPassword + "'"); - PasswordChangeRequestSpamMitigation - .removeRequestHistoryAndFrequencyData(userAccount.getEmailAddress()); notifyUser(); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index c6ecab622b..6df00e89ef 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -89,15 +89,6 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map dataContext.put("showPasswordChangeForm", false); - PasswordChangeRequestSpamMitigationResponse mitigationResponse = - PasswordChangeRequestSpamMitigation.checkPasswordResetRequestAllowed(email); - if (!mitigationResponse.getCanBeRequested()) { - dataContext.put("message", - i18n.text("password_reset_too_many_requests", mitigationResponse.getNextRequestAvailableAtDate(), - mitigationResponse.getNextRequestAvailableAtTime())); - return new TemplateResponseValues(TEMPLATE_NAME, dataContext); - } - Optional userAccountOptional = getAccountForInternalAuth(email); if (userAccountOptional.isPresent()) { requestPasswordChange(userAccountOptional.get(), userAccountsDao); @@ -106,7 +97,6 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map log.info("User tried to reset password with an unassociated email: " + email); } - PasswordChangeRequestSpamMitigation.updateRequestHandlingAndNotifyUserIfExists(email); return emailSentNotification(dataContext, i18n, email); } diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java deleted file mode 100644 index 76212c7277..0000000000 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigation.java +++ /dev/null @@ -1,75 +0,0 @@ -package edu.cornell.mannlib.vitro.webapp.controller.authenticate; - -import java.time.LocalDateTime; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -public class PasswordChangeRequestSpamMitigation { - - private static final Map requestHistory = new ConcurrentHashMap<>(); - - private static final Map requestFrequency = new ConcurrentHashMap<>(); - - private static final long INTERVAL_INCREASE_MINUTES = 10; - - - /** - * Initializes request history and frequency data for a given email address if it does not exist. - * - * @param emailAddress The email address for which to initialize request history and frequency data. - */ - private static void initializeHistoryRequestDataIfNotExists(String emailAddress) { - requestHistory.putIfAbsent(emailAddress, LocalDateTime.now()); - requestFrequency.putIfAbsent(emailAddress, 0); - } - - /** - * Checks whether a password reset request is allowed based on spam mitigation criteria. - * - * @param emailAddress The email address associated with the password reset request. - * @return A PasswordChangeRequestSpamMitigationResponse indicating if the request is allowed. - */ - public static PasswordChangeRequestSpamMitigationResponse checkPasswordResetRequestAllowed(String emailAddress) { - initializeHistoryRequestDataIfNotExists(emailAddress); - - Integer numberOfSuccessiveRequests = requestFrequency.get(emailAddress); - LocalDateTime momentOfFirstRequest = requestHistory.get(emailAddress); - LocalDateTime nextRequestAvailableAt = - momentOfFirstRequest.plusMinutes(numberOfSuccessiveRequests * INTERVAL_INCREASE_MINUTES); - - if (nextRequestAvailableAt.isAfter(LocalDateTime.now())) { - String[] dateTimeTokens = nextRequestAvailableAt.toString().split("T"); - String dateString = dateTimeTokens[0]; - String timeString = dateTimeTokens[1].split("\\.")[0]; - return new PasswordChangeRequestSpamMitigationResponse(false, dateString, timeString); - } - - if (numberOfSuccessiveRequests > 0) { - requestHistory.put(emailAddress, LocalDateTime.now()); - } - - return new PasswordChangeRequestSpamMitigationResponse(true); - } - - /** - * Updates request frequency and timestamp when a password reset request is successfully handled, - * and the user is notified. - * - * @param emailAddress The email address for which the request was successfully handled. - */ - public static void updateRequestHandlingAndNotifyUserIfExists(String emailAddress) { - requestFrequency.merge(emailAddress, 1, Integer::sum); - } - - - /** - * Removes request history and frequency data when a password reset request is successfully handled, - * and the user's password is updated. - * - * @param email The email address for which the request was successfully handled. - */ - public static void removeRequestHistoryAndFrequencyData(String email) { - requestHistory.remove(email); - requestFrequency.remove(email); - } -} diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java deleted file mode 100644 index 58025e8017..0000000000 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/PasswordChangeRequestSpamMitigationResponse.java +++ /dev/null @@ -1,46 +0,0 @@ -package edu.cornell.mannlib.vitro.webapp.controller.authenticate; - -public class PasswordChangeRequestSpamMitigationResponse { - - private Boolean canBeRequested; - - private String nextRequestAvailableAtDate; - - private String nextRequestAvailableAtTime; - - - public PasswordChangeRequestSpamMitigationResponse(Boolean canBeRequested, String nextRequestAvailableAtDate, - String nextRequestAvailableAtTime) { - this.canBeRequested = canBeRequested; - this.nextRequestAvailableAtDate = nextRequestAvailableAtDate; - this.nextRequestAvailableAtTime = nextRequestAvailableAtTime; - } - - public PasswordChangeRequestSpamMitigationResponse(Boolean canBeRequested) { - this.canBeRequested = canBeRequested; - } - - public Boolean getCanBeRequested() { - return canBeRequested; - } - - public void setCanBeRequested(Boolean canBeRequested) { - this.canBeRequested = canBeRequested; - } - - public String getNextRequestAvailableAtDate() { - return nextRequestAvailableAtDate; - } - - public void setNextRequestAvailableAtDate(String nextRequestAvailableAtDate) { - this.nextRequestAvailableAtDate = nextRequestAvailableAtDate; - } - - public String getNextRequestAvailableAtTime() { - return nextRequestAvailableAtTime; - } - - public void setNextRequestAvailableAtTime(String nextRequestAvailableAtTime) { - this.nextRequestAvailableAtTime = nextRequestAvailableAtTime; - } -} diff --git a/home/src/main/resources/config/example.runtime.properties b/home/src/main/resources/config/example.runtime.properties index 26eb8a86e9..f37ab0e19b 100644 --- a/home/src/main/resources/config/example.runtime.properties +++ b/home/src/main/resources/config/example.runtime.properties @@ -196,8 +196,8 @@ proxy.eligibleTypeList = http://www.w3.org/2002/07/owl#Thing #fileUpload.allowedMIMETypes = image/png, application/pdf # Feature toggle for forgot password functionality -authentication.forgotPassword = enabled -authentication.forgotPassword.notify-admin = true +authentication.forgotPassword = false +authentication.forgotPassword.notify-admin = false # Captcha configuration. Available implementations are: nanocaptcha (text-based) and recaptchav2 # nanocaptcha is available in 2 difficulties (easy and hard) From 19ec4811e7d41c9652cc06448a42eb99aae489fa Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 12 Feb 2024 16:17:34 +0100 Subject: [PATCH 44/63] Aligned example.runtime.properties with java code. --- home/src/main/resources/config/example.runtime.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/config/example.runtime.properties b/home/src/main/resources/config/example.runtime.properties index f37ab0e19b..85844e1f06 100644 --- a/home/src/main/resources/config/example.runtime.properties +++ b/home/src/main/resources/config/example.runtime.properties @@ -196,7 +196,7 @@ proxy.eligibleTypeList = http://www.w3.org/2002/07/owl#Thing #fileUpload.allowedMIMETypes = image/png, application/pdf # Feature toggle for forgot password functionality -authentication.forgotPassword = false +authentication.forgotPassword = disabled authentication.forgotPassword.notify-admin = false # Captcha configuration. Available implementations are: nanocaptcha (text-based) and recaptchav2 From 56d54f9b8f5f4ddbba4cb981598a574bcd4a0d14 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 19 Feb 2024 09:08:40 +0100 Subject: [PATCH 45/63] Corrected localization .ttl files indentation. --- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- .../firsttime/vitro_UiLabel.ttl | 54 +++++++++---------- 8 files changed, 216 insertions(+), 216 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index b2a9658c00..6279173d32 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Eine E-Mail zur Wiederherstellung des Passworts wird an {0} gesendet, wenn sie mit einem bestehenden Konto verknüpft ist."@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Die nächste Anfrage können Sie am {0} um {1}."@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Ich habe mein Passwort vergessen"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Passwort zurücksetzen"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Mein Passwort zurücksetzen"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Um Ihr Passwort zurückzusetzen, geben Sie bitte Ihre E-Mail-Adresse ein:"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Kontakt"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Funktionalität deaktiviert durch den Website-Administrator."@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 91c19842d4..5897182c0c 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Password recovery email has been sent to {0}, if it is associated with an existing account."@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "You will be able to send the next request on {0} at {1}."@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "I forgot my password"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Reset Password"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Reset my password"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "To reset your password, please enter your email address below:"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "If you don't remember your email, please"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "contact us"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Functionality disabled by site admin."@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index e8a20a90f1..a98fb1bba5 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Password recovery email has been sent to {0}, if it is associated with an existing account."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "You will be able to send the next request on {0} at {1}."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "I forgot my password"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Reset Password"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Reset my password"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "To reset your password, please enter your email address below:"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "If you don't remember your email, please"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "contact us"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Functionality disabled by site admin."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index d1172d63d6..d0ba2604c3 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Se ha enviado un correo de recuperación de la contraseña a {0}, si está vinculado a una cuenta existente."@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Podrás enviar una nueva petición el {0} a las {1}."@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Olvidé mi contraseña"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Restablecer Contraseña"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Restablecer mi contraseña"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Para restablecer la contraseña, introduce tu email a continuación:"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Si no recuerdas tu email, por favor"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Contacta con nosotros"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Funcionalidad desactivada por el administrador del sitio."@es ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index e47a0e32f6..db932011fe 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Un courriel de récupération du mot de passe est envoyé à {0}, s'il est lié à un compte existant."@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Vous pourrez envoyer la prochaine demande le {0} à {1}."@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "J'ai oublié mon mot de passe"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Réinitialiser le mot de passe"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Réinitialiser mon mot de passe"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Pour réinitialiser votre mot de passe, veuillez entrer votre adresse courriel ci-dessous:"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Si vous ne vous souvenez pas de votre adresse courriel, veuillez"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "nous contacter"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Fonctionnalité désactivée par l'administrateur du site."@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index ce166d78d7..937257aa29 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Um e-mail de recuperação de senha será enviado para a conta {0} se essa estiver vinculado a uma conta existente."@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Você poderá enviar a próxima solicitação no dia {0} às {1}."@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Esqueci a minha senha"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Redefinir Senha"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Redefinir minha senha"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Para redefinir sua senha, por favor insira seu endereço de email abaixo:"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Se você não se lembra do seu email, por favor"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "entre em contato conosco"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Funcionalidade desativada pelo administrador do site."@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 10f6c1560e..6837bf4e94 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Письмо для восстановления пароля отправлено на {0}, если оно связано с существующим аккаунтом."@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Следующий запрос вы сможете отправить {0} в {1}."@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Я забыл свой пароль"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Сброс пароля"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Сбросить пароль"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Для сброса пароля, введите ваш адрес электронной почты:"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста,"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "свяжитесь с нами"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Функциональность отключена администратором сайта."@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 69020c6ce5..943406eb78 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -258,73 +258,73 @@ uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Email za oporavak šifre je poslat na {0}, ako je povezan sa postojećim nalogom."@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_email_sent" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_email_sent" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_too_many_requests.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Sledeći zahtev za resetovanje lozinke ćete moći da pošaljete dana {0} u {1}."@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_too_many_requests" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Zaboravio sam lozinku"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_label" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_label" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_title.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Resetovanje Lozinke"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_title" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_title" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_button.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Resetuj moju lozinku"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_button" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_button" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Da resetujete lozinku, unesite vašu email adresu povezanu sa nalogom:"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_manual" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_manual" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_forgot_email_contact_us.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "kontaktirate"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_forgot_email_contact_us" ; + uil:hasPackage "Vitro-languages" . uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Funkcionalnost onemogućena od strane administratora sajta."@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "functionality_disabled" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "functionality_disabled" ; + uil:hasPackage "Vitro-languages" . uil-data:startup_status.Vitro rdf:type owl:NamedIndividual ; From 50200f4448b6df3236b7a4a0b71205bf74a995cc Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Tue, 20 Feb 2024 10:51:53 +0100 Subject: [PATCH 46/63] Removed leftover conflict markup. Updated styles. --- .../i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 1 - webapp/src/main/webapp/css/login.css | 3 +++ .../webapp/templates/freemarker/widgets/widget-login.ftl | 7 ------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 29f1ef3c36..3729c089e7 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6382,7 +6382,6 @@ uil-data:captcha_user_sol_invalid.Vitro uil:hasKey "captcha_user_sol_invalid" ; uil:hasPackage "Vitro-languages" . -<<<<<<< HEAD uil-data:captcha_not_displayed.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/css/login.css b/webapp/src/main/webapp/css/login.css index 68cd37dc7d..9effe8af4f 100644 --- a/webapp/src/main/webapp/css/login.css +++ b/webapp/src/main/webapp/css/login.css @@ -88,3 +88,6 @@ p.password-note { display: inline; vertical-align: middle; } +.reset-password-link { + display: block; +} diff --git a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl index f52371b815..99776a27d5 100644 --- a/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl +++ b/webapp/src/main/webapp/templates/freemarker/widgets/widget-login.ftl @@ -82,13 +82,6 @@ - - <#macro forcePasswordChange> From 28bf8c95e29935006877370dd0c10074ef113575 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 21 Feb 2024 09:08:26 +0100 Subject: [PATCH 47/63] Added email length check. --- .../controller/authenticate/ForgotPasswordController.java | 4 ++++ .../body/accounts/userAccounts-resetPasswordRequest.ftl | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 6df00e89ef..613cecfa54 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -80,6 +80,10 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map I18nBundle i18n = I18n.bundle(vreq); String email = getNonNullTrimmedParameterValue(vreq, "email"); + if (email.length() > 320 || !email.matches("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")) { + dataContext.put("errorMessage", i18n.text("error_invalid_email", email)); + return showForm(dataContext); + } if (!captchaIsValid(vreq)) { dataContext.put("wrongCaptcha", true); diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 4c7bd0cd9f..5c7ae6d104 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -12,6 +12,10 @@ + <#if errorMessage??> +

${errorMessage!}

+ + <#if captchaToUse == "RECAPTCHAV2">
From e66f97f57128b8bb82f55f63f44b2732c470a97e Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 21 Feb 2024 09:11:55 +0100 Subject: [PATCH 48/63] Removed leftover conflict markup in .ftl files. --- .../rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 3729c089e7..19c4dee085 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6389,7 +6389,7 @@ uil-data:captcha_not_displayed.Vitro uil:hasApp "Vitro" ; uil:hasKey "captcha_not_displayed" ; uil:hasPackage "Vitro-languages" . -======= + uil-data:suppress_operation_for_roles.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; @@ -6437,5 +6437,3 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . - ->>>>>>> main From bbd4ff2933daaa24b9b432100a282a6e96582fd1 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 21 Feb 2024 11:35:03 +0100 Subject: [PATCH 49/63] Removed unused labels. --- .../i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- 8 files changed, 64 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 19c4dee085..8dd9e63c29 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Die nächste Anfrage können Sie am {0} um {1}."@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index a52a40129f..905aa7db7e 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "You will be able to send the next request on {0} at {1}."@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index ef4437166e..4c7b092789 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "You will be able to send the next request on {0} at {1}."@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 891494c4a1..fb9553ff51 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Podrás enviar una nueva petición el {0} a las {1}."@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index fa8df8005c..755e4d94bf 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Vous pourrez envoyer la prochaine demande le {0} à {1}."@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index f658e88995..b98b5d1e02 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Você poderá enviar a próxima solicitação no dia {0} às {1}."@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index c16dde6dda..fad795bd05 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Следующий запрос вы сможете отправить {0} в {1}."@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 7ecde37258..af20e5a7a8 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -262,14 +262,6 @@ uil-data:password_reset_email_sent.Vitro uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_too_many_requests.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Sledeći zahtev za resetovanje lozinke ćete moći da pošaljete dana {0} u {1}."@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_too_many_requests" ; - uil:hasPackage "Vitro-languages" . - uil-data:password_reset_label.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; From c54222416b29b08a961ce96b8804ff795a27a7d4 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 21 Feb 2024 15:45:45 +0100 Subject: [PATCH 50/63] Refactored localization for contact form link. --- .../de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../en_US/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl | 10 +--------- .../interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../accounts/userAccounts-resetPasswordRequest.ftl | 3 ++- 9 files changed, 10 insertions(+), 65 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 8dd9e63c29..e169369009 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter"@de-DE ; + rdfs:label "Wenn Sie Ihre E-Mail-Adresse nicht mehr wissen, kontaktieren Sie uns bitte unter Kontakt."@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Kontakt"@de-DE ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 905aa7db7e..6d5c41bf4d 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "If you don't remember your email, please"@en-CA ; + rdfs:label "If you don't remember your email, please contact us."@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "contact us"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 4c7b092789..90b22d0801 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "If you don't remember your email, please"@en-US ; + rdfs:label "If you don't remember your email, please contact us."@en-US ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "contact us"@en-US ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index fb9553ff51..91d46692f3 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Si no recuerdas tu email, por favor"@es ; + rdfs:label "Si no recuerdas tu email, por favor Contacta con nosotros."@es ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "Contacta con nosotros"@es ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 755e4d94bf..e2404bbab8 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Si vous ne vous souvenez pas de votre adresse courriel, veuillez"@fr-CA ; + rdfs:label "Si vous ne vous souvenez pas de votre adresse courriel, veuillez nous contacter."@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "nous contacter"@fr-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index b98b5d1e02..47cefec983 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Se você não se lembra do seu email, por favor"@pt-BR ; + rdfs:label "Se você não se lembra do seu email, por favor entre em contato conosco."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "entre em contato conosco"@pt-BR ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index fad795bd05..7d57825ed9 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,19 +297,11 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста,"@ru-RU ; + rdfs:label "Если вы не помните свой адрес электронной почты, пожалуйста, свяжитесь с нами."@ru-RU ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "свяжитесь с нами"@ru-RU ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index af20e5a7a8..8220092f89 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -297,7 +297,7 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas"@sr-Latn-RS ; + rdfs:label "Ako se ne sećate vaše email adrese, molimo vas da nas kontaktirate."@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index 5c7ae6d104..af85a1d5e7 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -40,8 +40,9 @@
+ <#assign contactFormUrl = "${contactUrl}" /> <#if contactEmailConfigured> -

${i18n().password_reset_forgot_email} ${i18n().password_reset_forgot_email_contact_us}.

+

${i18n().password_reset_forgot_email(contactFormUrl)}

From 4348509d259ce207d3b0c9faf15668021567ff7b Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 22 Feb 2024 09:37:55 +0100 Subject: [PATCH 51/63] Removed leftover realperson files and theme styles. --- .../css/jquery_plugins/jquery.realperson.css | 38 ---- webapp/src/main/webapp/css/vitro.css | 8 - .../js/jquery_plugins/jquery.realperson.js | 183 ------------------ 3 files changed, 229 deletions(-) delete mode 100644 webapp/src/main/webapp/css/jquery_plugins/jquery.realperson.css delete mode 100644 webapp/src/main/webapp/js/jquery_plugins/jquery.realperson.js diff --git a/webapp/src/main/webapp/css/jquery_plugins/jquery.realperson.css b/webapp/src/main/webapp/css/jquery_plugins/jquery.realperson.css deleted file mode 100644 index bb5a7b1ec3..0000000000 --- a/webapp/src/main/webapp/css/jquery_plugins/jquery.realperson.css +++ /dev/null @@ -1,38 +0,0 @@ -/* http://keith-wood.name/realPerson.html - Real Person Form Submission for jQuery v1.0.1. - Written by Keith Wood (kwood{at}iinet.com.au) June 2009. - Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and - MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. - Please attribute the author if you use it. */ - -/* Real Person jQuery plugin styles v1.0.1. */ -.realperson-challenge { - display: inline-block; - background-color: #ddd; - width: 150px; - padding-top: 10px; - padding-left: 12px; -} -.realperson-text { - font-family: "Courier New",monospace; - font-size: 6px; - font-weight: bold; - letter-spacing: -1px; - line-height: 3px; - color: #000; -} -.realperson-regen { - padding-top: 4px; - padding-right: 6px; - font-size: 12px; - text-align: center; - cursor: pointer; -} -.realpersonLabel { - display: block; -} -#defaultReal { - margin-left: 20px; - vertical-align: top; - margin-top: 3px; -} diff --git a/webapp/src/main/webapp/css/vitro.css b/webapp/src/main/webapp/css/vitro.css index f784acd7fe..3564107c26 100644 --- a/webapp/src/main/webapp/css/vitro.css +++ b/webapp/src/main/webapp/css/vitro.css @@ -476,14 +476,6 @@ a.filter-search { margin: 0; margin-top: 13px; } -/* contact form security field */ -div .realperson-challenge { - width: 250px; - margin-right: 20px; -} -div .realperson-text { - text-align: center; -} /* TABLE STYLES USED IN ACCOUNTS AND PAGE MANAGEMENT */ table#table-listing { border-collapse: collapse; diff --git a/webapp/src/main/webapp/js/jquery_plugins/jquery.realperson.js b/webapp/src/main/webapp/js/jquery_plugins/jquery.realperson.js deleted file mode 100644 index cfc1b06a77..0000000000 --- a/webapp/src/main/webapp/js/jquery_plugins/jquery.realperson.js +++ /dev/null @@ -1,183 +0,0 @@ -/* http://keith-wood.name/realPerson.html - Real Person Form Submission for jQuery v1.0.1. - Written by Keith Wood (kwood{at}iinet.com.au) June 2009. - Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and - MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses. - Please attribute the author if you use it. */ - -(function($) { // Hide scope, no $ conflict - -var PROP_NAME = 'realPerson'; - -/* Real person manager. */ -function RealPerson() { - this._defaults = { - length: 6, // Number of characters to use - includeNumbers: false, // True to use numbers as well as letters - regenerate: 'Click to change', // Instruction text to regenerate - hashName: '{n}Hash' // Name of the hash value field to compare with, - // use {n} to substitute with the original field name - }; -} - -var CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; -var DOTS = [ - [' * ', ' * * ', ' * * ', ' * * ', ' ***** ', '* *', '* *'], - ['****** ', '* *', '* *', '****** ', '* *', '* *', '****** '], - [' ***** ', '* *', '* ', '* ', '* ', '* *', ' ***** '], - ['****** ', '* *', '* *', '* *', '* *', '* *', '****** '], - ['*******', '* ', '* ', '**** ', '* ', '* ', '*******'], - ['*******', '* ', '* ', '**** ', '* ', '* ', '* '], - [' ***** ', '* *', '* ', '* ', '* ***', '* *', ' ***** '], - ['* *', '* *', '* *', '*******', '* *', '* *', '* *'], - ['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'], - [' *', ' *', ' *', ' *', ' *', '* *', ' ***** '], - ['* *', '* ** ', '* ** ', '** ', '* ** ', '* ** ', '* *'], - ['* ', '* ', '* ', '* ', '* ', '* ', '*******'], - ['* *', '** **', '* * * *', '* * *', '* *', '* *', '* *'], - ['* *', '** *', '* * *', '* * *', '* * *', '* **', '* *'], - [' ***** ', '* *', '* *', '* *', '* *', '* *', ' ***** '], - ['****** ', '* *', '* *', '****** ', '* ', '* ', '* '], - [' ***** ', '* *', '* *', '* *', '* * *', '* * ', ' **** *'], - ['****** ', '* *', '* *', '****** ', '* * ', '* * ', '* *'], - [' ***** ', '* *', '* ', ' ***** ', ' *', '* *', ' ***** '], - ['*******', ' * ', ' * ', ' * ', ' * ', ' * ', ' * '], - ['* *', '* *', '* *', '* *', '* *', '* *', ' ***** '], - ['* *', '* *', ' * * ', ' * * ', ' * * ', ' * * ', ' * '], - ['* *', '* *', '* *', '* * *', '* * * *', '** **', '* *'], - ['* *', ' * * ', ' * * ', ' * ', ' * * ', ' * * ', '* *'], - ['* *', ' * * ', ' * * ', ' * ', ' * ', ' * ', ' * '], - ['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '*******'], - [' *** ', ' * * ', '* *', '* *', '* *', ' * * ', ' *** '], - [' * ', ' ** ', ' * * ', ' * ', ' * ', ' * ', '*******'], - [' ***** ', '* *', ' *', ' * ', ' ** ', ' ** ', '*******'], - [' ***** ', '* *', ' *', ' ** ', ' *', '* *', ' ***** '], - [' * ', ' ** ', ' * * ', ' * * ', '*******', ' * ', ' * '], - ['*******', '* ', '****** ', ' *', ' *', '* *', ' ***** '], - [' **** ', ' * ', '* ', '****** ', '* *', '* *', ' ***** '], - ['*******', ' * ', ' * ', ' * ', ' * ', ' * ', '* '], - [' ***** ', '* *', '* *', ' ***** ', '* *', '* *', ' ***** '], - [' ***** ', '* *', '* *', ' ******', ' *', ' * ', ' **** ']]; - -$.extend(RealPerson.prototype, { - /* Class name added to elements to indicate already configured with real person. */ - markerClassName: 'hasRealPerson', - - /* Override the default settings for all real person instances. - @param settings (object) the new settings to use as defaults - @return (RealPerson) this object */ - setDefaults: function(settings) { - $.extend(this._defaults, settings || {}); - return this; - }, - - /* Attach the real person functionality to an input field. - @param target (element) the control to affect - @param settings (object) the custom options for this instance */ - _attachRealPerson: function(target, settings) { - target = $(target); - if (target.hasClass(this.markerClassName)) { - return; - } - target.addClass(this.markerClassName); - var inst = {settings: $.extend({}, this._defaults)}; - $.data(target[0], PROP_NAME, inst); - this._changeRealPerson(target, settings); - }, - - /* Reconfigure the settings for a real person control. - @param target (element) the control to affect - @param settings (object) the new options for this instance or - (string) an individual property name - @param value (any) the individual property value (omit if settings is an object) */ - _changeRealPerson: function(target, settings, value) { - target = $(target); - if (!target.hasClass(this.markerClassName)) { - return; - } - settings = settings || {}; - if (typeof settings == 'string') { - var name = settings; - settings = {}; - settings[name] = value; - } - var inst = $.data(target[0], PROP_NAME); - $.extend(inst.settings, settings); - target.prevAll('.realperson-challenge,.realperson-hash').remove().end(). - before(this._generateHTML(target, inst)); - }, - - /* Generate the additional content for this control. - @param target (jQuery) the input field - @param inst (object) the current instance settings - @return (string) the additional content */ - _generateHTML: function(target, inst) { - var text = ''; - for (var i = 0; i < inst.settings.length; i++) { - text += CHARS.charAt(Math.floor(Math.random() * - (inst.settings.includeNumbers ? 36 : 26))); - } - var html = '
'; - for (var i = 0; i < DOTS[0].length; i++) { - for (var j = 0; j < text.length; j++) { - html += DOTS[CHARS.indexOf(text.charAt(j))][i].replace(/ /g, ' ') + - '  '; - } - html += '
'; - } - html += '
' + inst.settings.regenerate + - '
'; - return html; - }, - - /* Remove the real person functionality from a control. - @param target (element) the control to affect */ - _destroyRealPerson: function(target) { - target = $(target); - if (!target.hasClass(this.markerClassName)) { - return; - } - target.removeClass(this.markerClassName). - prevAll('.realperson-challenge,.realperson-hash').remove(); - $.removeData(target[0], PROP_NAME); - }, - - /* Compute a hash value for the given text. - @param value (string) the text to hash - @return the corresponding hash value */ - _hash: function(value) { - var hash = 5381; - for (var i = 0; i < value.length; i++) { - hash = ((hash << 5) + hash) + value.charCodeAt(i); - } - return hash; - } -}); - -/* Attach the real person functionality to a jQuery selection. - @param command (string) the command to run (optional, default 'attach') - @param options (object) the new settings to use for these instances (optional) - @return (jQuery) for chaining further calls */ -$.fn.realperson = function(options) { - var otherArgs = Array.prototype.slice.call(arguments, 1); - return this.each(function() { - if (typeof options == 'string') { - $.realperson['_' + options + 'RealPerson']. - apply($.realperson, [this].concat(otherArgs)); - } - else { - $.realperson._attachRealPerson(this, options || {}); - } - }); -}; - -/* Initialise the real person functionality. */ -$.realperson = new RealPerson(); // singleton instance - -$( document ).on('click', '.realperson-challenge', function() { - $(this).next().next().realperson('change'); -}); - -})(jQuery); From 55bbe7cf4177985ac67f9d0ca65f1fcdbf9b8961 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20R=2E=20Mr=C5=A1ulja?= Date: Fri, 23 Feb 2024 08:50:34 +0100 Subject: [PATCH 52/63] Update home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl Co-authored-by: Dragan Ivanovic --- .../rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 90b22d0801..e8f030aed5 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6329,7 +6329,7 @@ uil-data:no_individual_associated_with_id.Vitro uil-data:password_reset_admin_notification_email_subject.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "${siteName} reset password request"@en-CA ; + rdfs:label "Password Reset Request for ${siteName}"@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_admin_notification_email_subject" ; uil:hasPackage "Vitro-languages" . From 0c2e8d9a1f80719f91509c764846c301542e305c Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 1 Mar 2024 14:37:30 +0100 Subject: [PATCH 53/63] Added translations for admin email notification. --- .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 20 ++++++++-------- .../firsttime/vitro_UiLabel.ttl | 20 ++++++++-------- .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ .../firsttime/vitro_UiLabel.ttl | 24 +++++++++++++++++++ 8 files changed, 164 insertions(+), 20 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index e169369009..5e83c06026 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6421,3 +6421,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} Anfrage zur Zurücksetzung des Passworts"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Wir haben eine Anfrage erhalten, das Passwort für den Benutzer ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}) zurückzusetzen.\n\nSie erhalten diese E-Mail, weil Administratorbenachrichtigungen für Passwortzurücksetzungen aktiviert sind."@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Wir haben eine Anfrage erhalten, das Passwort für den Benutzer ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}) zurückzusetzen.




Sie erhalten diese E-Mail, weil Administratorbenachrichtigungen für Passwortzurücksetzungen aktiviert sind.

"@de-DE ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 6d5c41bf4d..a887221c40 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6330,25 +6330,25 @@ uil-data:password_reset_admin_notification_email_subject.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "${siteName} reset password request"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_subject" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_admin_notification_email_plain_text.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nYou are receiving this because admin notifications for password resets are enabled.\n"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_plain_text" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_admin_notification_email_html.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "

\n We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n

\n\n

\n You are receiving this because admin notifications for password resets are enabled.

"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_html" ; - uil:hasPackage "Vitro-languages" . + rdfs:label "


We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




You are receiving this because admin notifications for password resets are enabled.

"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . uil-data:full_name_empty.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index e8f030aed5..3b336a7745 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6330,25 +6330,25 @@ uil-data:password_reset_admin_notification_email_subject.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "Password Reset Request for ${siteName}"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_subject" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_admin_notification_email_plain_text.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; rdfs:label "We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nYou are receiving this because admin notifications for password resets are enabled.\n"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_plain_text" ; - uil:hasPackage "Vitro-languages" . + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . uil-data:password_reset_admin_notification_email_html.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "

\n We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n

\n\n

\n You are receiving this because admin notifications for password resets are enabled.

"@en-CA ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_admin_notification_email_html" ; - uil:hasPackage "Vitro-languages" . + rdfs:label "


We have received a request to reset the password for user ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




You are receiving this because admin notifications for password resets are enabled.

"@en-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . uil-data:full_name_empty.Vitro rdf:type owl:NamedIndividual ; diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 91d46692f3..3515e0e3a6 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6421,3 +6421,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} solicitud de restablecimiento de contraseña"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Hemos recibido una solicitud para restablecer la contraseña del usuario ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nUsted está recibiendo este mensaje porque las notificaciones de administrador para restablecimientos de contraseña están habilitadas."@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Hemos recibido una solicitud para restablecer la contraseña del usuario ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




Usted está recibiendo este mensaje porque las notificaciones de administrador para restablecimientos de contraseña están habilitadas.

"@es ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index e2404bbab8..bf74fb04c0 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6421,3 +6421,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} demande de réinitialisation de mot de passe"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Nous avons reçu une demande de réinitialisation du mot de passe pour l'utilisateur ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nVous recevez ce message car les notifications administratives pour les réinitialisations de mot de passe sont activées."@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Nous avons reçu une demande de réinitialisation du mot de passe pour l'utilisateur ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




Vous recevez ce message car les notifications administratives pour les réinitialisations de mot de passe sont activées.

"@fr-CA ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index 47cefec983..a378732609 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6421,3 +6421,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} solicitação de redefinição de senha"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Recebemos uma solicitação para redefinir a senha do usuário ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nVocê está recebendo este email porque as notificações de administrador para redefinições de senha estão habilitadas."@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Recebemos uma solicitação para redefinir a senha do usuário ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




Você está recebendo este email porque as notificações de administrador para redefinições de senha estão habilitadas.

"@pt-BR ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 7d57825ed9..0ae3c91929 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6421,3 +6421,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} запрос на сброс пароля"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Мы получили запрос на сброс пароля для пользователя ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nВы получили это письмо, потому что уведомления администратора о сбросе пароля включены."@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Мы получили запрос на сброс пароля для пользователя ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




Вы получили это письмо, потому что уведомления администратора о сбросе пароля включены.

"@ru-RU ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 8220092f89..4a5424b6ef 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -6429,3 +6429,27 @@ uil-data:suppress_operation_for_unrelated_individuals_of_this_class.Vitro uil:hasApp "Vitro" ; uil:hasKey "suppress_operation_for_unrelated_individuals_of_this_class" ; uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_subject.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "${siteName} zahtev za resetovanje lozinke"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_subject" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_plain_text.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "Primili smo zahtev za resetovanje lozinke za korisnika ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).\n\nDobili ste ovu poruku jer su obaveštenja za administratore o resetovanju lozinke omogućena."@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_plain_text" ; + uil:hasPackage "Vitro-languages" . + +uil-data:password_reset_admin_notification_email_html.Vitro + rdf:type owl:NamedIndividual ; + rdf:type uil:UILabel ; + rdfs:label "


Primili smo zahtev za resetovanje lozinke za korisnika ${userAccount.firstName} ${userAccount.lastName} (${userAccount.emailAddress}).




Dobili ste ovu poruku jer su obaveštenja za administratore o resetovanju lozinke omogućena.

"@sr-Latn-RS ; + uil:hasApp "Vitro" ; + uil:hasKey "password_reset_admin_notification_email_html" ; + uil:hasPackage "Vitro-languages" . From 1b704508c65e0e9899d935ca53c5c461eacffa3d Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Wed, 6 Mar 2024 13:28:02 +0100 Subject: [PATCH 54/63] Moved styles to separate css files, refactored selectors. --- .../main/webapp/css/account/passwordReset.css | 41 ++++++++++++++ .../userAccounts-resetPasswordRequest.ftl | 56 ++----------------- 2 files changed, 47 insertions(+), 50 deletions(-) create mode 100644 webapp/src/main/webapp/css/account/passwordReset.css diff --git a/webapp/src/main/webapp/css/account/passwordReset.css b/webapp/src/main/webapp/css/account/passwordReset.css new file mode 100644 index 0000000000..a07fcbc0ce --- /dev/null +++ b/webapp/src/main/webapp/css/account/passwordReset.css @@ -0,0 +1,41 @@ +/* $This file is distributed under the terms of the license in LICENSE$ */ + +/* styles for password reset */ + +label[for="email"] { + font-size: 18px; + display: block; + margin-bottom: 5px; +} + +input#email { + font-size: 16px; + height: 1.5em; + width: 20em; + margin-bottom: 2em; +} + +.submit button.green { + font-size: 16px; +} + +.paragraph-text { + font-size: 16px; +} + +.notification-text { + font-size: 24px; +} + +#defaultReal { + display: block; + margin-top: 1em; + margin-left: 0; + width: 246px; +} + +#forgotPasswordForm .errorMessage { + color: red; + background: #efefef; + padding: 1em; +} diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index af85a1d5e7..db43703a41 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -1,10 +1,11 @@ <#-- $This file is distributed under the terms of the license in LICENSE$ --> <#-- Template for notifying user about reset password request state --> +${stylesheets.add('')} <#if isEnabled && emailConfigured> <#if showPasswordChangeForm == true> -

${i18n().password_reset_title}

+

${i18n().password_reset_title}


@@ -20,7 +21,7 @@
<#elseif captchaToUse == "NANOCAPTCHA"> -

+

@@ -42,60 +43,15 @@
<#assign contactFormUrl = "${contactUrl}" /> <#if contactEmailConfigured> -

${i18n().password_reset_forgot_email(contactFormUrl)}

+

${i18n().password_reset_forgot_email(contactFormUrl)}

<#else> -

${message}

+

${message}

<#else> -

${i18n().functionality_disabled}

+

${i18n().functionality_disabled}

- - <#include "webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl"> From 2831dfa23bc7464c7667920b1edb2e8936c4ddf7 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 14 Mar 2024 10:47:58 +0100 Subject: [PATCH 55/63] Code cleanup and slight email check refactoring. --- .../controller/authenticate/ForgotPasswordController.java | 8 +++++++- .../sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl | 8 -------- .../body/captcha/captcha-clientExecutionLogic.ftl | 3 --- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 613cecfa54..39d7ea4297 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -79,8 +79,14 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map UserAccountsDao userAccountsDao = constructUserAccountsDao(); I18nBundle i18n = I18n.bundle(vreq); + // Check for impossible length input + if (vreq.getParameter("email").length() > 320) { + dataContext.put("errorMessage", i18n.text("error_invalid_email", vreq.getParameter("email"))); + return showForm(dataContext); + } + String email = getNonNullTrimmedParameterValue(vreq, "email"); - if (email.length() > 320 || !email.matches("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")) { + if (!email.matches("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}")) { dataContext.put("errorMessage", i18n.text("error_invalid_email", email)); return showForm(dataContext); } diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 4a5424b6ef..09866798e2 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -302,14 +302,6 @@ uil-data:password_reset_forgot_email.Vitro uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . -uil-data:password_reset_forgot_email_contact_us.Vitro - rdf:type owl:NamedIndividual ; - rdf:type uil:UILabel ; - rdfs:label "kontaktirate"@sr-Latn-RS ; - uil:hasApp "Vitro" ; - uil:hasKey "password_reset_forgot_email_contact_us" ; - uil:hasPackage "Vitro-languages" . - uil-data:functionality_disabled.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; diff --git a/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl index 330d721f2f..5413bc5221 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl @@ -1,15 +1,12 @@ <#assign isEnabled = isEnabled!true> ${stylesheets.add('')} -${scripts.add('', - '')} <#if isEnabled && captchaToUse == "RECAPTCHAV2"> From a4f9209b9c7935439aaaab7ba039f9dd7021e3c2 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 25 Mar 2024 09:50:43 +0100 Subject: [PATCH 56/63] Fixed potential NPE and improved error message localization. --- .../controller/authenticate/ForgotPasswordController.java | 5 +++-- .../i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- 9 files changed, 11 insertions(+), 10 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 39d7ea4297..9df75abae8 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -80,8 +80,9 @@ private ResponseValues handlePostRequest(VitroRequest vreq, Map I18nBundle i18n = I18n.bundle(vreq); // Check for impossible length input - if (vreq.getParameter("email").length() > 320) { - dataContext.put("errorMessage", i18n.text("error_invalid_email", vreq.getParameter("email"))); + String rawEmailInput = vreq.getParameter("email"); + if (rawEmailInput != null && rawEmailInput.length() > 320) { + dataContext.put("errorMessage", i18n.text("error_invalid_email")); return showForm(dataContext); } diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 5e83c06026..62aa904ff0 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' is not a valid email address."@de-DE ; + rdfs:label "Die von Ihnen angegebene E-Mail-Adresse ist ungültig."@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index a887221c40..0c1d748f46 100644 --- a/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' is not a valid email address."@en-CA ; + rdfs:label "The email you have provided is not a valid email address."@en-CA ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl index 3b336a7745..aedb481253 100644 --- a/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/en_US/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' is not a valid email address."@en-US ; + rdfs:label "The email you have provided is not a valid email address."@en-US ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 3515e0e3a6..3c1da09a5e 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' no es una dirección de correo electrónico válida."@es ; + rdfs:label "La dirección de correo electrónico que ha proporcionado no es válida."@es ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index bf74fb04c0..6673ce616a 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' n'est pas une adresse courriel valide."@fr-CA ; + rdfs:label "L'adresse e-mail que vous avez fournie n'est pas une adresse e-mail valide."@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index a378732609..8c11d8b307 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "'' {0} '' não é um endereço de email válido."@pt-BR ; + rdfs:label "O e-mail que você forneceu não é um endereço de e-mail válido."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl index 0ae3c91929..f0c3143a74 100644 --- a/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/ru_RU/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' не является действительным адресом электронной почты."@ru-RU ; + rdfs:label "Электронная почта, которую вы указали, не является действительным адресом электронной почты."@ru-RU ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl index 09866798e2..9ebf657aa1 100644 --- a/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/sr_Latn_RS/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "''{0}'' nije ispravna email adresa."@sr-Latn-RS ; + rdfs:label "Email koji ste naveli nije validna email adresa."@sr-Latn-RS ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . From a5ab1084cee41e548e1e9877c982616ef8d2b5f5 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 8 Apr 2024 09:23:39 +0200 Subject: [PATCH 57/63] Fixed minor licencing and tag usage errors. --- .../controller/authenticate/ForgotPasswordController.java | 2 ++ .../cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java | 1 - .../body/accounts/userAccounts-resetPasswordRequest.ftl | 4 ++-- .../freemarker/body/captcha/captcha-clientExecutionLogic.ftl | 2 ++ .../webapp/templates/freemarker/edit/forms/css/customForm.css | 2 +- 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java index 9df75abae8..1ee5f7d380 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/controller/authenticate/ForgotPasswordController.java @@ -1,3 +1,5 @@ +/* $This file is distributed under the terms of the license in LICENSE$ */ + package edu.cornell.mannlib.vitro.webapp.controller.authenticate; import java.net.MalformedURLException; diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java index 67eb04423f..2c03190f8e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/widgets/LoginWidget.java @@ -175,7 +175,6 @@ private State getCurrentLoginState(HttpServletRequest request) { /** * A LoginProcessBean is outdated unless the the "in-process" flag is set in the * session. - *

* Each time we hit Authenticate, the flag is set, and each time * we draw the widget it is reset. */ diff --git a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl index db43703a41..1ba948899e 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/accounts/userAccounts-resetPasswordRequest.ftl @@ -48,10 +48,10 @@ ${stylesheets.add('${message} +

${message}

<#else> -

${i18n().functionality_disabled}

+

${i18n().functionality_disabled}

<#include "webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl"> diff --git a/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl index 5413bc5221..3662accc16 100644 --- a/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl +++ b/webapp/src/main/webapp/templates/freemarker/body/captcha/captcha-clientExecutionLogic.ftl @@ -1,3 +1,5 @@ +<#-- $This file is distributed under the terms of the license in LICENSE$ --> + <#assign isEnabled = isEnabled!true> ${stylesheets.add('')} diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css index c5535cef49..9f014c0803 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css @@ -177,4 +177,4 @@ img#indicator { } :-ms-input-placeholder { /* Internet Explorer 10+ */ opacity: .25; -} +} \ No newline at end of file From a7bf2ac73bbe7fe25f1469b71558d1c01e890562 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 12 Apr 2024 09:15:43 +0200 Subject: [PATCH 58/63] Removed useless blank line in css file. --- .../webapp/templates/freemarker/edit/forms/css/customForm.css | 1 - 1 file changed, 1 deletion(-) diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css index 9f014c0803..5b31f67416 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css @@ -164,7 +164,6 @@ section#pubsContainer input { img#indicator { padding-left:60px; } - /* for placeholder text */ ::-webkit-input-placeholder { /* WebKit browsers */ opacity: .25; From f7de431f66e8f7ce8f8a6186c5dd49ba0ae46163 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 12 Apr 2024 09:19:18 +0200 Subject: [PATCH 59/63] Added newline at the end of file. --- .../webapp/templates/freemarker/edit/forms/css/customForm.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css index 5b31f67416..9172e67bd8 100644 --- a/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css +++ b/webapp/src/main/webapp/templates/freemarker/edit/forms/css/customForm.css @@ -176,4 +176,4 @@ img#indicator { } :-ms-input-placeholder { /* Internet Explorer 10+ */ opacity: .25; -} \ No newline at end of file +} From d2bc008fc53a61c4a2474ab1932e80643685db3a Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Fri, 12 Apr 2024 15:28:32 +0200 Subject: [PATCH 60/63] Updated example properties. --- home/src/main/resources/config/example.runtime.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/config/example.runtime.properties b/home/src/main/resources/config/example.runtime.properties index 85844e1f06..cae4534fc5 100644 --- a/home/src/main/resources/config/example.runtime.properties +++ b/home/src/main/resources/config/example.runtime.properties @@ -195,7 +195,7 @@ proxy.eligibleTypeList = http://www.w3.org/2002/07/owl#Thing #comma separated list of mime types allowed for upload #fileUpload.allowedMIMETypes = image/png, application/pdf -# Feature toggle for forgot password functionality +# Feature toggle for forgot password functionality [enabled, disabled] authentication.forgotPassword = disabled authentication.forgotPassword.notify-admin = false From b7a5339f746ab30d89583562ad96b172aba45fd5 Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Mon, 15 Apr 2024 17:44:57 +0200 Subject: [PATCH 61/63] Updated spanish localization. --- .../rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl index 3c1da09a5e..c9cb7f4aed 100644 --- a/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/es/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -289,7 +289,7 @@ uil-data:password_reset_button.Vitro uil-data:password_reset_manual.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Para restablecer la contraseña, introduce tu email a continuación:"@es ; + rdfs:label "Para restablecer la contraseña, introduzca su email a continuación:"@es ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_manual" ; uil:hasPackage "Vitro-languages" . @@ -297,7 +297,7 @@ uil-data:password_reset_manual.Vitro uil-data:password_reset_forgot_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Si no recuerdas tu email, por favor Contacta con nosotros."@es ; + rdfs:label "Si no recuerda su email, por favor Contacte con nosotros."@es ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_forgot_email" ; uil:hasPackage "Vitro-languages" . From 4644d245420c008d24861164c4fd65ff29226fa0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20R=2E=20Mr=C5=A1ulja?= Date: Thu, 9 May 2024 15:22:51 +0200 Subject: [PATCH 62/63] Update home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl Co-authored-by: Benjamin Kampe --- .../rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl index 62aa904ff0..74c1c75fc0 100644 --- a/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/de_DE/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,7 +257,7 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Eine E-Mail zur Wiederherstellung des Passworts wird an {0} gesendet, wenn sie mit einem bestehenden Konto verknüpft ist."@de-DE ; + rdfs:label "Eine E-Mail zur Wiederherstellung des Passworts wird an {0} gesendet, wenn die Adresse mit einem bestehenden Konto verknüpft ist."@de-DE ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . From 44f9bdd72f27fdabb7575ebf50809df3ac4c086e Mon Sep 17 00:00:00 2001 From: Ivan Mrsulja Date: Thu, 9 May 2024 15:25:06 +0200 Subject: [PATCH 63/63] Updated localization. --- .../rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl | 2 +- .../rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl index 6673ce616a..b763cd47ee 100644 --- a/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/fr_CA/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -3241,7 +3241,7 @@ uil-data:javascript_instructions.Vitro uil-data:error_invalid_email.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "L'adresse e-mail que vous avez fournie n'est pas une adresse e-mail valide."@fr-CA ; + rdfs:label "L'adresse électronique que vous avez fournie n'est pas valide."@fr-CA ; uil:hasApp "Vitro" ; uil:hasKey "error_invalid_email" ; uil:hasPackage "Vitro-languages" . diff --git a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl index 8c11d8b307..08d1635612 100644 --- a/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl +++ b/home/src/main/resources/rdf/i18n/pt_BR/interface-i18n/firsttime/vitro_UiLabel.ttl @@ -257,7 +257,7 @@ uil-data:reset_password_note.Vitro uil-data:password_reset_email_sent.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Um e-mail de recuperação de senha será enviado para a conta {0} se essa estiver vinculado a uma conta existente."@pt-BR ; + rdfs:label "Um e-mail de recuperação de senha será enviado para a conta {0} se essa estiver vinculada a uma conta existente."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "password_reset_email_sent" ; uil:hasPackage "Vitro-languages" . @@ -6369,7 +6369,7 @@ uil-data:captcha_user_sol_invalid.Vitro uil-data:captcha_not_displayed.Vitro rdf:type owl:NamedIndividual ; rdf:type uil:UILabel ; - rdfs:label "Atualizar página se não estiver sendo exibida..."@pt-BR ; + rdfs:label "Atualizar a página se não estiver sendo exibida..."@pt-BR ; uil:hasApp "Vitro" ; uil:hasKey "captcha_not_displayed" ; uil:hasPackage "Vitro-languages" .