February 17, 2011
EE Passwd Plugin
EE1 Allows users to change their password. Features:
- Supports a list of disallowed passwords (for forcing users to change their password)
- Can require current password (or not)
- Users don’t need to re-login
Get the EE Passwd Plugin from GitHub.
Documentation
Parameters
new_password
= The name of the form field or field array which supply the new user passwordexpired_passwords
= (optional) A pipe "|" separated list of disallowed/expired passwordsold_password
= (optional) The form field with the current password, only checked if not expiredsecure
= (optional) Set to "y" to post the new password using https
Variables
{passwd_form} {/passwd_form}
= Wrap your change password form and writes HTML <form> elements
Conditionals
{if no_results}
= If a required parameter is missing, or the user is not a logged in user{if error}
= The submitted password was blank, did not match, or was not secure per EE settings{if changed}
= The user's password has been changed{if password_expired}
= The user's current password is in theexpired_passwords
list
Example
The example below allows a user to change their password and requires their existing password if it's not in the expired list.
{exp:passwd
expired_passwords="changeme|firstlogin"
old_password="oldpass"
new_password="newpass"
secure="y"
}
{if changed}
<p>Password Changed!</p>
{if:elseif error}
<p>Passwords did not match, were blank, or were not secure.</p>
{/if}
{if password_expired}
{passwd_form}
New Password: <input type="password" name="newpass[1]" /><br/>
New Password: <input type="password" name="newpass[2]" /><br/>
<input type="submit" value="Change" />
{/passwd_form}
{if:else}
{passwd_form}
Existing Password: <input type="password" name="oldpass" /><br/>
New Password: <input type="password" name="newpass[1]" /><br/>
New Password: <input type="password" name="newpass[2]" /><br/>
<input type="submit" value="Change" />
{/passwd_form}
{/if}
{/exp:passwd}