Description
This function changes an account's password.
Warning:
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
Examples
Note:
Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
Parameter |
Type |
Description |
Possible values |
Example |
user |
string |
Required The account name. |
A valid cPanel account username.
|
username |
oldpass |
string |
Required The account's current password. |
A secure password. |
luggage12345 |
newpass |
string |
Required The new password. |
A secure password. |
luggage54321 |
Returns
Return |
Type |
Description |
Possible values |
Example |
passwdoutput |
string |
The function's raw output. |
A result message. |
Password for \u201cexample\u201d has been changed.\nUpdating FTP passwords for example\nFTP password files updated.\nFTP vhost passwords synced\n |
statustxt |
string |
The text of the result message. |
A result message. |
Password changed for user \u201cexample\u201d |
reason |
string |
A reason for failure. Note: This function only returns areasonvalue if it failed. |
A string that describes the error. |
This is an error message. |
result |
boolean |
Whether the function succeeded. |
|
1 |