NIHVIVO-2279 Implement account editing and password change.

This commit is contained in:
j2blake 2011-05-26 16:29:33 +00:00
parent d6bacf0c95
commit a1915c8398
22 changed files with 1006 additions and 223 deletions

View file

@ -68,6 +68,8 @@
<label for="initial-password">Initial password<span class="requiredHint"> *</span></label>
<input type="password" name="initialPassword" value="${initialPassword}" id="initial-password" role="input "/>
<p>Minimum of ${minimumLength} characters in length.</p>
<label for="confirm-password">Confirm initial password<span class="requiredHint"> *</span></label>
<input type="text" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input "/>
</#if>
@ -79,10 +81,6 @@
<input type="radio" name="associate" value="no" role="radio" <#if !associate??>checked</#if> id="no-associate" />
<label class="inline" for="no-associate"> No</label>
<br />
<input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" />
<label class="inline" for="reset-password"> Reset password</label>
<#if emailIsEnabled??>
<p class="note">
Note: An email will be sent to the address entered above

View file

@ -2,7 +2,7 @@
<#-- Template for adding a user account -->
<h3>Add new account</h3>
<h3>Create your Password</h3>
<#if errorPasswordIsEmpty??>
<#assign errorMessage = "No password supplied." />
@ -23,23 +23,23 @@
</section>
</#if>
<section id="add-account" role="region">
<section id="create-password" role="region">
<fieldset>
<legend>Add new account</legend>
<legend>Please enter your new password for ${userAccount.emailAddress}</legend>
<form method="POST" action="${formUrls.createPassword}" class="customForm" role="create password">
<input type="hidden" name="user" value="${userAccount.emailAddress}" />
<input type="hidden" name="key" value="${userAccount.passwordLinkExpiresHash}" />
<label for="password">Password<span class="requiredHint"> *</span></label>
<input type="password" name="password" value="${password}" id="password" role="input "/>
<label for="new-password">Password<span class="requiredHint"> *</span></label>
<input type="password" name="newPassword" value="${newPassword}" id="new-password" role="input "/>
<p>Minimum of ${minimumLength} characters in length.</p>
<label for="confirm-password">Confirm Password<span class="requiredHint"> *</span></label>
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input "/>
<input type="submit" name="submitCreatePassword" value="Save changes" class="submit"/>
<input type="submit" name="submit" value="Save changes" class="submit"/>
<p class="requiredHint">* required fields</p>
</form>

View file

@ -2,5 +2,103 @@
<#-- Template for editing a user account -->
<h3>Edit user account</h3>
<h3>Edit account</h3>
<#if errorEmailIsEmpty??>
<#assign errorMessage = "You must supply an email address." />
</#if>
<#if errorEmailInUse??>
<#assign errorMessage = "An account with that email address already exists." />
</#if>
<#if errorFirstNameIsEmpty??>
<#assign errorMessage = "You must supply a first name." />
</#if>
<#if errorLastNameIsEmpty??>
<#assign errorMessage = "You must supply a last name." />
</#if>
<#if errorNoRoleSelected??>
<#assign errorMessage = "You must select a role." />
</#if>
<#if errorPasswordIsEmpty??>
<#assign errorMessage = "No password supplied." />
</#if>
<#if errorPasswordIsWrongLength??>
<#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." />
</#if>
<#if errorPasswordsDontMatch??>
<#assign errorMessage = "Passwords do not match." />
</#if>
<#if errorMessage?has_content>
<section id="error-alert" role="alert">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alert="Error alert icon"/>
<p>${errorMessage}</p>
</section>
</#if>
<section id="edit-account" role="region">
<fieldset>
<legend>Edit new account</legend>
<form method="POST" action="${formUrls.edit}" class="customForm" role="edit account">
<label for="email-address">Email address<span class="requiredHint"> *</span></label>
<input type="text" name="emailAddress" value="${emailAddress}" id="email-address" role="input "/>
<label for="first-name">First name<span class="requiredHint"> *</span></label>
<input type="text" name="firstName" value="${firstName}" id="first-name" role="input "/>
<label for="last-name">Last name<span class="requiredHint"> *</span></label>
<input type="text" name="lastName" value="${lastName}" id="last-name" role="input "/>
<p>Roles<span class="requiredHint"> *</span> </p>
<#list roles as role>
<input type="radio" name="role" value="${role.uri}" role="radio" <#if selectedRole = role.uri>selected</#if> />
<label class="inline" for="${role.label}"> ${role.label}</label>
<br />
</#list>
<#if !emailIsEnabled??>
<label for="new-password">New password<span class="requiredHint"> *</span></label>
<input type="password" name="newPassword" value="${newPassword}" id="new-password" role="input "/>
<p>Minimum of ${minimumLength} characters in length.</p>
<p>Leaving this blank means that the password will not be changed.</p>
<label for="confirm-password">Confirm initial password<span class="requiredHint"> *</span></label>
<input type="text" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input "/>
</#if>
<p>Associate a profile with this account</p>
<input type="radio" name="associate" value="yes" role="radio" <#if associate??>checked</#if> id="associate" />
<label class="inline" for="associate"> Yes</label>
<input type="radio" name="associate" value="no" role="radio" <#if !associate??>checked</#if> id="no-associate" />
<label class="inline" for="no-associate"> No</label>
<br />
<input type="checkbox" name="resetPassword" value="" id="reset-password" role="checkbox" />
<label class="inline" for="reset-password"> Reset password</label>
<#if emailIsEnabled??>
<p class="note">
Note: A confirmation email with instructions for resetting a password
will be sent to the address entered above.
The password will not be reset until the user follows the link provided in this email.
</p>
</#if>
<input type="submit" name="submitEdit" value="Save changes" class="submit"/> or <a href="${formUrls.list}">Cancel</a>
<p class="requiredHint">* required fields</p>
</form>
</fieldset>
</section>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}

View file

@ -47,8 +47,26 @@
<p>
A new account for
<a href="${newUserAccount.editUrl}">${newUserAccount.firstName} ${newUserAccount.lastName}</a>
was successfully created. A notification email has been sent to ${newUserAccount.emailAddress}
with instructions for activating the account and creating a password.
was successfully created.
<#if emailWasSent?? >
A notification email has been sent to ${newUserAccount.emailAddress}
with instructions for activating the account and creating a password.
</#if>
</p>
</section>
</#if>
<#if updatedUserAccount?? >
<section class="account-feedback">
<p>
The account for
<a href="${updatedUserAccount.editUrl}">${updatedUserAccount.firstName} ${updatedUserAccount.lastName}</a>
has been updated.
<#if emailWasSent?? >
A confirmation email has been sent to ${updatedUserAccount.emailAddress}
with instructions for resetting a password.
The password will not be reset until the user follows the link provided in this email.
</#if>
</p>
</section>
</#if>

View file

@ -1,6 +1,6 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Confirmation that an account has been created. -->
<#-- Confirmation that an password has been created. -->
<html>
<head>
@ -16,7 +16,7 @@
</p>
<p>
Yout new password associated with ${userAccount.emailAddress} has been created.
Your new password associated with ${userAccount.emailAddress} has been created.
</p>
<p>

View file

@ -1,6 +1,6 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Confirmation that an account has been created. -->
<#-- Confirmation that a password has been created. -->
${userAccount.firstName} ${userAccount.lastName}

View file

@ -0,0 +1,26 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Confirmation that an password has been reset. -->
<html>
<head>
<title>${subjectLine}</title>
</head>
<body>
<p>
${userAccount.firstName} ${userAccount.lastName}
</p>
<p>
<strong>Password successfully changed.</strong>
</p>
<p>
Your new password associated with ${userAccount.emailAddress} has been changed.
</p>
<p>
Thank you.
</p>
</body>
</html>

View file

@ -0,0 +1,12 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Confirmation that a password has been reset. -->
${userAccount.firstName} ${userAccount.lastName}
Password successfully changed.
Your new password associated with ${userAccount.emailAddress}
has been changed.
Thank you.

View file

@ -0,0 +1,49 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for adding a user account -->
<h3>Reset your Password</h3>
<#if errorPasswordIsEmpty??>
<#assign errorMessage = "No password supplied." />
</#if>
<#if errorPasswordIsWrongLength??>
<#assign errorMessage = "Password must be between ${minimumLength} and ${maximumLength} characters." />
</#if>
<#if errorPasswordsDontMatch??>
<#assign errorMessage = "Passwords do not match." />
</#if>
<#if errorMessage?has_content>
<section id="error-alert" role="alert">
<img src="${urls.images}/iconAlert.png" width="24" height="24" alert="Error alert icon"/>
<p>${errorMessage}</p>
</section>
</#if>
<section id="reset-password" role="region">
<fieldset>
<legend>Please enter your new password for ${userAccount.emailAddress}</legend>
<form method="POST" action="${formUrls.resetPassword}" class="customForm" role="create password">
<input type="hidden" name="user" value="${userAccount.emailAddress}" />
<input type="hidden" name="key" value="${userAccount.passwordLinkExpiresHash}" />
<label for="new-password">Password<span class="requiredHint"> *</span></label>
<input type="password" name="newPassword" value="${newPassword}" id="new-password" role="input "/>
<p>Minimum of ${minimumLength} characters in length.</p>
<label for="confirm-password">Confirm Password<span class="requiredHint"> *</span></label>
<input type="password" name="confirmPassword" value="${confirmPassword}" id="confirm-password" role="input "/>
<input type="submit" name="submit" value="Save changes" class="submit"/>
<p class="requiredHint">* required fields</p>
</form>
</fieldset>
</section>
${stylesheets.add('<link rel="stylesheet" href="${urls.base}/edit/forms/css/customForm.css" />')}

View file

@ -0,0 +1,40 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Notification that your password has been reset. -->
<html>
<head>
<title>${subjectLine}</title>
</head>
<body>
<p>
${userAccount.firstName} ${userAccount.lastName}
</p>
<p>
We received a request to reset the password for your account (${userAccount.emailAddress}).
Please follow the instructions below to proceed with your password reset.
</p>
<p>
If you did not request this new account you can safely ignore this email.
This request will expire if not acted upon for 30 days.
</p>
<p>
Click the link below to reset your password using our secure server.
</p>
<p>
<a href="${passwordLink}">${passwordLink}</a>
</p>
<p>
If the link above doesn't work, you can copy and paste the link directly into your browser's address bar.
</p>
<p>
Thank you!
</p>
</body>
</html>

View file

@ -0,0 +1,19 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Notification that your password has been reset. -->
${userAccount.firstName} ${userAccount.lastName}
We received a request to reset the password for your account
(${userAccount.emailAddress}).
Please follow the instructions below to proceed with your password reset.
If you did not request this new account you can safely ignore this email.
This request will expire if not acted upon for 30 days.
Paste the link below into your browser's address bar to reset your password
using our secure server.
${passwordLink}
Thank you!