Why do we need to change user’s password?
For example - the user has forgotten their password and get it changed through the forgotten password form.
But the user wants to have his own, easily memorable password.
After logging the user appear two options - to update the profile fields with general information or to change the password.
<span><a href="update-profile.html">Update Profile</a></span>
<span style="margin-left:15px;"><a href="change-password.html">Change password</a></span>
I made a new document called "change-password". ChangePassword snipet use as follows:
[[!ChangePassword? &reloadOnSuccess=`0` &successMessage=`[[!%login.change_password? &namespace=`login` &topic=`changepassword`]] - [[!%login.profile_updated? &namespace=`login` &topic=`updateprofile`]]`]]
<div class="change-password">
<div style="color:#66CC00">[[+logcp.successMessage]] </div>
<form class="form" action="[[~[[*id]]]]" method="post">
<input type="hidden" name="nospam:blank" value="" />
<label for="password_old">[[!%login.password_old? &namespace=`login` &topic=`changepassword`]]:
<span class="error">[[+logcp.error.password_old]]</span>
</label>
<input type="password" name="password_old" id="password_old" value="[[+logcp.password_old]]" />
<label for="password_new">[[!%login.password_new? &namespace=`login` &topic=`changepassword`]]:
<span class="error">[[+logcp.error.password_new]]</span>
</label>
<input type="password" name="password_new" id="password_new" value="[[+logcp.password_new]]" />
<label for="password_new_confirm">[[!%login.password_new_confirm? &namespace=`login` &topic=`changepassword`]]:
<span class="error">[[+logcp.error.password_new_confirm]]</span>
</label>
<input type="password" name="password_new_confirm" id="password_new_confirm" value="[[+logcp.password_new_confirm]]" />
<br class="clear" />
<div class="form-buttons">
<input type="submit" name="logcp-submit" value="[[!%login.change_password]]" />
</div>
</form>
</div>
If filled in correctly for the old password field and fields for a new password, then change will be successful. Otherwise you will derive the corresponding error messages.
* I do not know why the current password field is named "old password". The password that is entered is current and not old. When I change it gets old, but is no longer current. Logically it is correct to say - current password.