How It Works
The modal endpoints, the password-update flow and the email merge fields.
Password-update flow
- An admin clicks Change Password in the Manage Users dropdown, or uses the input on the profile tab.
- The modal loads with the user’s name and email and a password field with a generator.
- On save, the password is updated and an audit row is written.
- If the checkbox is ticked, the Change User Password email is sent with the
user_passwordmerge field.
Endpoints
All endpoints live on addonmodules.php?module=ChangePassword, are addressed root-relative and require POST plus a CSRF token.
| Action | Purpose |
|---|---|
a=index | Serves the Change Password form as AJAX {body} markup, for a given userid. |
a=store | Persists the new password. |
a=password | Generates a random password sized to the configured length and character types. |
Direct GET is rejected — opening an endpoint in the browser returns the WHMCS HTTP Method Not Allowed page. That is expected and matches core WHMCS routes.
What the hooks do
- Profile field — swaps the disabled password input for a working one with a generator button.
- Manage Users action — appends Change Password to the user dropdown.
- Admin header output — loads the script that powers the generator and the modal.
- Daily cron — prunes activity-log rows older than the retention setting.
Email merge fields
The seeded template supports {$user_first_name}, {$user_email}, {$user_password}, {$whmcs_link} and {$signature}.