.pdf)
WHM Plugins
suspendacct function from within your custom script:
/xml-api/suspendacct function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/xml-api/suspendacct
suspendacct function from within your custom script:
/json-api/suspendacct function call name, plus the required variables (see below), to a URL which includes the address of your server.
example.com, you would include the following string in your script: https://example.com:2087/json-api/suspendacct
suspendacct function takes the following variables as input.
The following variable is required: suspendacct function. 1 — yes.
0 — no.
https://example.com:2087/xml-api/suspendacct?user=user123 in WebHost Manager will produce output similar to:
<suspendacct>
<result>
<status>1</status>
<statusmsg>
<script>if (self['clear_ui_status']) { clear_ui_status(); }</script>
Changing Shell to /bin/false...Changing shell for user123.
Warning: "/bin/false" is not listed in /etc/shells
Shell changed.
Done
Locking Password...Locking password for user user123.
passwd: Success
Done
Suspending mysql users
Notification => user@example.net via EMAIL [level => 3]
Using Quota v3 Support
Suspended document root /home/cpanel1/public_html
Using Quota v3 Support
Suspending FTP accounts...
Updating ftp passwords for user123
Ftp password files updated.
Ftp vhost passwords synced
user123's account has been suspended
</statusmsg>
</result>
</suspendacct>
https://example.com:2087/json-api/suspendacct?user=user123 in WebHost Manager will produce output similar to:
{
"result":[
{
"status":1,
"statusmsg":"<script>if (self['clear_ui_status']) { clear_ui_status(); }</script>
\nChanging Shell to /bin/false...Changing shell for user123.\nWarning: \"/bin/false\"
is not listed in /etc/shells\nShell changed.\nDone\nLocking Password...Locking
password for user user123.\npasswd: Success\nDone\nSuspending mysql users\n
Notification => user@example.com via EMAIL [level => 3]\nUsing Quota v3
Support\nSuspended document root /home/user123/public_html\nUsing Quota v3
Support\nSuspending FTP accounts...\nUpdating ftp passwords for user123\nFtp
password files updated.\nFtp vhost passwords synced\nuser123's account has
been suspended\n"
}
]
}