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;

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,6 +79,7 @@
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>
<div id="passwordContainer">
<table> <table>
<tr> <tr>
<td> <td>
@ -93,6 +95,7 @@
</table> </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 />
@ -104,3 +107,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>')}

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,6 +75,7 @@
</#if> </#if>
<#if emailIsEnabled??> <#if emailIsEnabled??>
<div id="pwdResetContainer" <#if externalAuthOnly?? >class="hidden"</#if> >
<input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" <#if resetPassword??>checked</#if> /> <input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" <#if resetPassword??>checked</#if> />
<label class="inline" for="reset-password"> Reset password</label> <label class="inline" for="reset-password"> Reset password</label>
@ -82,7 +84,9 @@
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>
<div id="passwordContainer" <#if externalAuthOnly?? >class="hidden"</#if> >
<table> <table>
<tr> <tr>
<td> <td>
@ -98,6 +102,7 @@
</table> </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>
<p class="explanatoryText">Leaving this blank means that the password will not be changed.</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>')}