VIVO-919 and VIVO-1007: added the max password length to login widget class and also corrected the variable reference in the template for the minimum length (was minimumLength not minimumPasswordLength).

This commit is contained in:
Tim Worrall 2015-03-27 16:05:42 -04:00
parent 8e429ca878
commit 0a78ab5687
2 changed files with 4 additions and 2 deletions

View file

@ -58,7 +58,8 @@ public class LoginWidget extends Widget {
EXTERNAL_AUTH_URL("externalAuthUrl"), EXTERNAL_AUTH_URL("externalAuthUrl"),
CANCEL_URL("cancelUrl"), CANCEL_URL("cancelUrl"),
SITE_NAME("siteName"), SITE_NAME("siteName"),
MINIMUM_PASSWORD_LENGTH("minimumPasswordLength"); MINIMUM_PASSWORD_LENGTH("minimumPasswordLength"),
MAXIMUM_PASSWORD_LENGTH("maximumPasswordLength");
private final String variableName; private final String variableName;
@ -173,6 +174,7 @@ public class LoginWidget extends Widget {
values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request)); values.put(TemplateVariable.FORM_ACTION.toString(), getAuthenticateUrl(request));
values.put(TemplateVariable.CANCEL_URL.toString(), getCancelUrl(request)); values.put(TemplateVariable.CANCEL_URL.toString(), getCancelUrl(request));
values.put(TemplateVariable.MINIMUM_PASSWORD_LENGTH.toString(), UserAccount.MIN_PASSWORD_LENGTH); values.put(TemplateVariable.MINIMUM_PASSWORD_LENGTH.toString(), UserAccount.MIN_PASSWORD_LENGTH);
values.put(TemplateVariable.MAXIMUM_PASSWORD_LENGTH.toString(), UserAccount.MAX_PASSWORD_LENGTH);
String errorMessage = bean.getErrorMessageAndClear(); String errorMessage = bean.getErrorMessageAndClear();
if (!errorMessage.isEmpty()) { if (!errorMessage.isEmpty()) {

View file

@ -90,7 +90,7 @@
<label for="newPassword">${i18n().new_password_capitalized}</label> <label for="newPassword">${i18n().new_password_capitalized}</label>
<input id="newPassword" name="newPassword" class="text-field focus" type="password" required autofocus/> <input id="newPassword" name="newPassword" class="text-field focus" type="password" required autofocus/>
<p class="password-note">${i18n().minimum_password_length(minimumLength, maximumLength)}</p> <p class="password-note">${i18n().minimum_password_length(minimumPasswordLength, maximumPasswordLength)}</p>
<label for="confirmPassword">${i18n().confirm_password_capitalized}</label> <label for="confirmPassword">${i18n().confirm_password_capitalized}</label>
<input id="confirmPassword" name="confirmPassword" class="text-field" type="password" required /> <input id="confirmPassword" name="confirmPassword" class="text-field" type="password" required />