Skip to content

Commit

Permalink
SAK-32217 Alter timing of Passwords mismatch message on add or edit a…
Browse files Browse the repository at this point in the history
…ccount pages. (sakaiproject#3949)
  • Loading branch information
RebeccaMiller-Which authored and ottenhoff committed Feb 23, 2017
1 parent 737ac44 commit 94888da
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion user/user-tool/tool/src/webapp/js/userCreateValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ USER.verifyPasswordsMatch = function () {
var noMatchMsg = USER.get("noMatchMsg");

USER.passwordsMatch = pw === pw2;
if (pw.length > 0 || pw2.length > 0) {
if (pw.length > 0 && pw2.length > 0) {
USER.display(matchMsg, USER.passwordsMatch);
USER.display(noMatchMsg, !USER.passwordsMatch);
}
Expand Down
4 changes: 2 additions & 2 deletions user/user-tool/tool/src/webapp/js/userEditValidation.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ USER.verifyPasswordsMatch = function () {
var verPass = pw0.value;
USER.passwordsMatch = pass === verPass;

if (pass.length > 0 || verPass.length > 0) {
if (pass.length > 0 && verPass.length > 0) {
USER.display(matchMsg, USER.passwordsMatch);
USER.display(noMatchMsg, !USER.passwordsMatch);
}
Expand All @@ -105,7 +105,7 @@ USER.verifyPasswordsMatch = function () {
}
}
else {
USER.passwordsMatch = true;
return;
}

USER.validateForm();
Expand Down
4 changes: 2 additions & 2 deletions user/user-tool/tool/src/webapp/vm/user/chef_users_create.vm
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ${includeLatestJQuery}
<label for="user_pw">
#if ($pwRequired) <span class="reqStar">*</span> #end $tlang.getString("usecre.crenewpass")
</label>
<input type="password" name="pw" id="user_pw" oninput="USER.validatePassword();" onkeyup="USER.validatePassword();" onblur="USER.displayStrengthInfo();" onfocus="USER.displayStrengthInfo();" autocomplete="off" />
<input type="password" name="pw" id="user_pw" oninput="USER.validatePassword();" oninput="USER.hideAllElements();USER.validateForm();" onblur="USER.displayStrengthInfo();USER.validatePassword();" onfocus="USER.displayStrengthInfo();" autocomplete="off" />
<div id="strongMsg" style="display:none">$tlang.getString("pw.strong")</div>
<div id="moderateMsg" style="display:none">$tlang.getString("pw.moderate")</div>
<div id="weakMsg" style="display:none">$tlang.getString("pw.weak")</div>
Expand All @@ -80,7 +80,7 @@ ${includeLatestJQuery}
<label for="user_pw0">
#if ($pwRequired) <span class="reqStar">*</span> #end $tlang.getString("usecre.vernewpass")
</label>
<input type="password" name="pw0" id="user_pw0" oninput="USER.verifyPasswordsMatch();" onkeyup="USER.verifyPasswordsMatch();" autocomplete="off" />
<input type="password" name="pw0" id="user_pw0" oninput="USER.hideAllElements();USER.validateForm();" onblur="USER.verifyPasswordsMatch();" autocomplete="off" />
<div id="matchMsg" style="display:none">$tlang.getString("pw.match")</div>
<div id="noMatchMsg" style="display:none">$tlang.getString("pw.noMatch")</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions user/user-tool/tool/src/webapp/vm/user/chef_users_edit.vm
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function removeOptionalAttributeBlock(elem) {
<label for="user_pw">
$tlang.getString("usecre.crenewpass")
</label>
<input type="password" name="pw" id="user_pw" oninput="USER.validatePassword();" onkeyup="USER.validatePassword();" onblur="USER.displayStrengthInfo();" onfocus="USER.displayStrengthInfo();" autocomplete="off" />
<input type="password" name="pw" id="user_pw" onkeyup="USER.verifyPasswordsMatch()" onblur="USER.displayStrengthInfo();USER.validatePassword();" onfocus="USER.displayStrengthInfo();" autocomplete="off" />
<div id="strongMsg" style="display:none">$tlang.getString("pw.strong")</div>
<div id="moderateMsg" style="display:none">$tlang.getString("pw.moderate")</div>
<div id="weakMsg" style="display:none">$tlang.getString("pw.weak")</div>
Expand All @@ -138,7 +138,7 @@ function removeOptionalAttributeBlock(elem) {
<label for="user_pw0">
$tlang.getString("usecre.vernewpass")
</label>
<input type="password" name="pw0" id="user_pw0" oninput="USER.verifyPasswordsMatch();" onkeyup="USER.verifyPasswordsMatch();" autocomplete="off" />
<input type="password" name="pw0" id="user_pw0" onkeyup="USER.verifyPasswordsMatch()" onblur="USER.verifyPasswordsMatch();" autocomplete="off" />
<div id="matchMsg" style="display:none">$tlang.getString("pw.match")</div>
<div id="noMatchMsg" style="display:none">$tlang.getString("pw.noMatch")</div>
</div>
Expand Down

0 comments on commit 94888da

Please sign in to comment.