User Documentation

User:Reset_Password template tag

The User:Reset_Password function allows your users to reset their passwords after submitting the User:Forgot_Password form, using the password_reset_template parameter to point to the page where the User:Reset_Password form will be found.

{exp:user:reset_password} content {/exp:user:reset_password}

Parameters

The following parameters are available for use:

error_page=

error_page="user/error_template"

This parameter allows you to bypass the EE message template for displaying errors, and instead show your own regular template with the error messages. Error template must follow guidelines of User Error Page.

form:attribute=

form:class="your_class"

This parameter allows you to control any form attribute for the form in your template. Simply replace attribute with an attribute name such as id, name, class, etc, and specify a value for that attribute. You can specify this parameter multiple times to control as many attributes as necessary. This would normally be done to control your form with Javascript or style it with CSS.

onsubmit=

onsubmit="some_javascript()"

This parameter allows you to execute Javascript functions at form submission.

reset_code=

reset_code="{segment_3}"

This parameter is the incoming reset token from the URL, generated from the User:Forgot_Password - password_reset_template parameter which was emailed to the user as a reset link. The easiest way to use this parameter is to specify the segment you set in your password_reset_template parameter.

Without this parameter, User:Reset_Password cannot work. This must be correctly set.

return=

return="user/success"

This parameter allows you specify a return URL you'd like the user to be returned to after submitting the form.

secure_action=

secure_action="yes"

This parameter allows you to set the action on the form to have https://. Use for processing forms with SSL.

secure_return=

secure_return="yes"

This parameter allows you to set the return on the form to have https://. Use for processing forms with SSL.

Conditionals

The following conditionals are available for use:

user_no_results

{if user_no_results}
    The reset token provided is invalid.
{/if}

This conditional is used in the form for when the token given for the reset form is invalid. If this conditional is not present in the form, the error will default to a system error to inform the user of the bad token.

Form Fields

The following form fields are available for use:

password

<input type="password" name="password" />

This is the field in which the user would specify their new password for the account.

password_confirm

<input type="password" name="password_confirm" />

This is the field in which the user would retype the password they've entered in the password field.

Examples

The following is a complete example of what a Reset Password form might look like:

<h2>Reset Password</h2>
<p>This form will allow you to reset your password.</p>

{exp:user:reset_password
    reset_code="{segment_3}"
    return="user/success"
}
    <h4>Reset Password</h4>
    <p>
        <label for="password">New Password</label>
        <input type="password" name="password" id="password" />
    </p>
    <p>
        <label for="password_confirm">Confirm New Password</label>
        <input type="password" name="password_confirm" id="password_confirm" />
    </p>
    <p>
        <button type="submit">Update Password</button>
    </p>
{if user_no_results}
    <p>The reset token provided is invalid.</p>
{/if}
{/exp:user:reset_password}

Support

Having problems setting up and/or using User? Support is offered from 10am to 4pm EST weekdays. Send us an email at help@eeharbor.com and we will respond as quickly as we can.