.pdf)
WHM Plugins
removeacct function from within your custom script:
/xml-api/removeacct 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/removeacct
removeacct function from within your custom script:
/json-api/removeacct 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/removeacct
removeacct function takes the following variables as input.
The following variable is required: 1 — yes.
2 — no. (This is the default value.)
removeacct function. 1 — success.
0 — failure.
https://example.com:2087/xml-api/removeacct?user=user123 in WebHost Manager will produce something similar to:
<removeacct>
<result>
<rawout>
Running pre removal script (/scripts/prekillacct)......Done
Collecting Domain Name and IP...User: user123
Domain: example.com...Done
Killing all processes owned by user......Done
Cleaning passwd,shadow,group......Done
Removing User from Group..........Done
Removing Web Logs......Done
Removing Bandwidth Files......Done
Removing Crontab......Done
Removing Virtual Hosts...Removed Extra Entries from httpd.conf...Done
Removing MySQL databases and users......Done
Removing PostgreSQL databases and users......Done
Removing System User......Done
Removing Group......Done
Removing DNS Entries...example.com => deleted from server. ...Done
Removing Email Setup...
Removing /etc/valiases/example.com...Done
Removing mailman lists......Done
Removing remotedomains,secondarymx,localdomains entries......Done
Removing Counter Data......Done
Adding ip back to the ip address pool...System has 2 free ips....Done
Removing user's cPanel Databases and Updating......Done
Reloading Services......Done
Removing mail and service configs......Done
Sending Contacts......Done
Updating internal databases...Updating ftp passwords for user123
Purging ftp user user123
Ftp password files updated.
Ftp vhost passwords synced...Done
Running post removal scripts (/scripts/legacypostkillacct,
/scripts/postkillacct)......Done
Account Removal Complete!!!...user123 account removed...Done
</rawout>
<status>1</status>
<statusmsg>user123 account removed</statusmsg>
</result>
</removeacct>
https://example.com:2087/json-api/removeacct?user=user123 in WebHost Manager will produce something similar to:
{
"result":[
{
"status":1,
"statusmsg":"user123 account removed",
"rawout":"Running pre removal script (/scripts/prekillacct)......DoneCollecting
Domain Name and IP...User: user123\nDomain: example.com\n...DoneKilling all processes
owned by user......DoneCleaning passwd,shadow,group......DoneRemoving
User from Group..........DoneRemoving Web Logs......DoneRemoving Bandwidth Files......
DoneRemoving Crontab......DoneRemoving Virtual Hosts...Removed Extra Entries
from httpd.conf\nexample.com not found in httpd.conf.\nRemoved Entry from
proftpd.conf\n...DoneRemoving MySQL databases and users......DoneRemoving
PostgreSQL databases and users......DoneRemoving System User......DoneRemoving
Group......DoneRemoving DNS Entries...example.com => deleted from server.
\n...DoneRemoving Email Setup...Removing /etc/valiases/example.com\n...DoneRemoving
mailman lists......DoneRemoving remotedomains,secondarymx,localdomains
entries......DoneRemoving Counter Data......DoneAdding ip back to the ip address
pool...System has 0 free ips.\n...DoneRemoving user's cPanel Databases &
Updating......DoneReloading Services......DoneRemoving mail and service
configs...\n...DoneSending Contacts......DoneUpdating internal databases...Updating ftp
passwords for user123\nPurging ftp user user123\nFtp password files updated.\nFtp vhost
passwords synced\n...DoneRunning post removal scripts (/scripts/legacypostkillacct,
/scripts/postkillacct)......DoneAccount Removal Complete!!!...user123 account
removed...Done"
}
]
}