User 2.0 Delete Form
The User:Delete_Form function allows you and/or your users to delete their member account via the front end. Super Admin's and member groups that are allows to administrate other users can delete other user accounts. Super Admin's cannot be deleted with this form. Regular members need to have the EE settings for ability to delete own account to use this function.
{exp:user:delete_form} content {/exp:user:delete_form}
Parameters
The following parameters are available for use:
form_id=
form_id="this_form_id"
The 'form_id' parameter allows you to specify an ID for the form in order to control it with Javascript or style it with CSS.
form_name=
form_name="this_form"
The 'form_name' parameter allows you to specify a name for the form in order to control it with Javascript or style it with CSS.
return=
return="user/thank_you_template"
The 'return' parameter allows you to return the user to a specified template upon submittal of form.
Variables
Most standard member fields are available for use.
Form Fields
The following parameters are available for use:
password=
<input type="password" name="password" />
The 'password' field is required, as the current password is needed to delete the account. If a user is deleting their own account, they enter their password. If an administrator (any member of a member group with member administration privilages) deletes another user's account, the admin enters their own password.
Examples
The following is a complete example of how to implement this function. Access the template with a member ID in the URL. There is also a built in confirmation warning:
{exp:user:delete_form}
<h2>Delete Account: {screen_name}</h2>
<div>
<h3>You must confirm your password to complete this action.</h3>
<p><strong>Password:</strong></p>
<p><input type="password" name="password" /></p>
</div>
<div>
<p>Are you sure you wish to delete your account? All entries, posts, comments, and other
content associated with your account will also be deleted.</p>
<p><strong style="color: #f00;">WARNING: THIS ACTION CANNOT BE UNDONE!</strong></p>
</div>
<p><input type="submit" value="Submit" /></p>
{/exp:user:delete_form}