NIHVIVO-2848: changes to support the new externalAuthOnly flag

This commit is contained in:
tworrall 2011-07-12 19:45:09 +00:00
parent 3044b4c2c2
commit 3be6ec7b86
4 changed files with 82 additions and 38 deletions

View file

@ -50,6 +50,12 @@ table#account td a {
table#account tr:nth-child(2n) { table#account tr:nth-child(2n) {
background-color: rgba(200, 200, 180,.25); background-color: rgba(200, 200, 180,.25);
} }
input#externalAuthChkBox {
height:18px;
width:18px;
margin-top:10px;
margin-bottom:10px;
}
#filter-roles { #filter-roles {
float: left; float: left;
padding-bottom: 20px; padding-bottom: 20px;
@ -246,4 +252,4 @@ padding-right: 5px;
-moz-border-radius-bottomright: 5px; -moz-border-radius-bottomright: 5px;
-webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 5px;
-webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-right-radius: 5px;
} }

View file

@ -0,0 +1,26 @@
/* $This file is distributed under the terms of the license in /doc/license.txt$ */
// Change form actions in account main page
$(document).ready(function(){
// The externalAuthOnly checkbox drives the display of the password and re-set
// password fields. When checked, the password fields are hidden
$('input:checkbox[name=externalAuthOnly]').click(function(){
if ( this.checked ) {
// If checked, hide those puppies
$('#passwordContainer').addClass('hidden');
$('#pwdResetContainer').addClass('hidden');
// And clear any values entered in the password fields
$('input[name=confirmPassword]').val("");
$('input[name=initialPassword]').val("");
$('input[name=newPassword]').val("");
}
else {
// if not checked, display them
$('#passwordContainer').removeClass('hidden');
$('#pwdResetContainer').removeClass('hidden');
}
});
});

View file

@ -64,6 +64,7 @@
<#include "userAccounts-associateProfilePanel.ftl"> <#include "userAccounts-associateProfilePanel.ftl">
<p><input id="externalAuthChkBox" type="checkbox" name="externalAuthOnly" <#if externalAuthOnly?? >checked</#if> /><span>Externally Authenticated Only</span></p>
<p>Roles<span class="requiredHint"> *</span></p> <p>Roles<span class="requiredHint"> *</span></p>
<#list roles as role> <#list roles as role>
<input type="radio" name="role" value="${role.uri}" role="radio" <#if selectedRole = role.uri>checked</#if> /> <input type="radio" name="role" value="${role.uri}" role="radio" <#if selectedRole = role.uri>checked</#if> />
@ -78,21 +79,23 @@
It will include instructions for activating the account and creating a password. It will include instructions for activating the account and creating a password.
</p> </p>
<#else> <#else>
<table> <div id="passwordContainer">
<tr> <table>
<td> <tr>
<label for="initial-password">Initial password<span class="requiredHint"> *</span></label> <td>
<input type="password" name="initialPassword" value="${initialPassword}" id="initial-password" role="input" /> <label for="initial-password">Initial password<span class="requiredHint"> *</span></label>
</td> <input type="password" name="initialPassword" value="${initialPassword}" id="initial-password" role="input" />
<td>&nbsp;</td> </td>
<td> <td>&nbsp;</td>
<label for="confirm-password">Confirm initial password<span class="requiredHint"> *</span></label> <td>
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" /> <label for="confirm-password">Confirm initial password<span class="requiredHint"> *</span></label>
</td> <input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" />
</tr> </td>
</table> </tr>
</table>
<p class="explanatoryText" style="margin-top:-8px">Minimum of ${minimumLength} characters in length.</p> <p class="explanatoryText" style="margin-top:-8px">Minimum of ${minimumLength} characters in length.</p>
</div>
</#if> </#if>
<br /> <br />
@ -103,4 +106,6 @@
</section> </section>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/account/account.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/account/account.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/account/accountExternalAuthFlag.js"></script>')}

View file

@ -64,6 +64,7 @@
<#include "userAccounts-associateProfilePanel.ftl"> <#include "userAccounts-associateProfilePanel.ftl">
<p><input id="externalAuthChkBox" type="checkbox" name="externalAuthOnly" <#if externalAuthOnly?? >checked</#if> /><span>Externally Authenticated Only</span></p>
<#if roles?has_content> <#if roles?has_content>
<p>Roles<span class="requiredHint"> *</span></p> <p>Roles<span class="requiredHint"> *</span></p>
<#list roles as role> <#list roles as role>
@ -74,30 +75,34 @@
</#if> </#if>
<#if emailIsEnabled??> <#if emailIsEnabled??>
<input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" <#if resetPassword??>checked</#if> /> <div id="pwdResetContainer" <#if externalAuthOnly?? >class="hidden"</#if> >
<label class="inline" for="reset-password"> Reset password</label> <input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" <#if resetPassword??>checked</#if> />
<label class="inline" for="reset-password"> Reset password</label>
<p class="note"> <p class="note">
Note: Instructions for resetting the password will Note: Instructions for resetting the password will
be emailed to the address entered above. The password will not be emailed to the address entered above. The password will not
be reset until the user follows the link provided in this email. be reset until the user follows the link provided in this email.
</p> </p>
</div>
<#else> <#else>
<table> <div id="passwordContainer" <#if externalAuthOnly?? >class="hidden"</#if> >
<tr> <table>
<td> <tr>
<label for="new-password">New password<span class="requiredHint"> *</span></label> <td>
<input type="password" name="newPassword" value="${newPassword}" id="new-password" role="input" /> <label for="new-password">New password<span class="requiredHint"> *</span></label>
</td> <input type="password" name="newPassword" value="${newPassword}" id="new-password" role="input" />
<td>&nbsp;</td> </td>
<td> <td>&nbsp;</td>
<label for="confirm-password">Confirm new password<span class="requiredHint"> *</span></label> <td>
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" /> <label for="confirm-password">Confirm new password<span class="requiredHint"> *</span></label>
</td> <input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input" />
</tr> </td>
</table> </tr>
<p class="explanatoryText" style="margin-top:-8px">Minimum of ${minimumLength} characters in length.</p> </table>
<p class="explanatoryText">Leaving this blank means that the password will not be changed.</p> <p class="explanatoryText" style="margin-top:-8px">Minimum of ${minimumLength} characters in length.</p>
<p class="explanatoryText">Leaving this blank means that the password will not be changed.</p>
</div>
</#if> </#if>
<br /> <br />
<input type="submit" name="submitEdit" value="Save changes" class="submit" /> or <a class="cancel" href="${formUrls.list}">Cancel</a> <input type="submit" name="submitEdit" value="Save changes" class="submit" /> or <a class="cancel" href="${formUrls.list}">Cancel</a>
@ -108,3 +113,5 @@
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/account/account.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/css/account/account.css" />')}
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')} ${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}
${scripts.add('<script type="text/javascript" src="${urls.base}/js/account/accountExternalAuthFlag.js"></script>')}