CPanel
From ISPWiki
Contents |
Integration module functions
Creating account
The OpenAccount function
- Locates the server, domain, user, package in the base.
- Gets the information about account's IP-addresses (whether the account has assigned IP-addresses, their number) from the base.
- Sends a request to the CPanel server to create an account (login, domain, package are taken from the base, password is generated, if necessary, assigned IP-address parameter request is sent to Cpanel. If any, it will be assigned, if no, the error will be generated and stored in /usr/local/ispmgr/var/cpcpanel.log.
- Calls AddDetails to overwrite the package add-ons with those added manually (if any): bandwidth,disk,emaillimit, databaselimit,webdomainlimit.
Deleting account
The DeleteAccount function
- Locates the account in the database.
- Sends a request to the CPanel server (deleting the account).
- Deletes all the IP-addresses assigned to this account from itemip
Disabling account
The SuspendAccount function
- Locates the account in the database.
- Sends a request to the CPanel server (the account is given status 3 which means that the account is disabled).
Enabling account
The ResumeAccount function
- Locates the account in the database.
- Sends a request to the CPanel server (the account is given status 2 which means that the account is activated).
Changing package
The SetAccountParam function
- Locates the account in the database.
- Sends a request to the CPanel server (change the package).
- Calls AddDetails to overwrite the package add-ons with those added manually (if any)):bandwidth,disk,emaillimit, databaselimit,webdomainlimit.
Getting package (preset) information from the CPanel server
The GetServerConfig function
- Sends a request to the CPanel server (package names (account templates) are read on the CPanel server).
- Lists all the packages from the server in the config column of the server table.
Checking CPanel server connection to the
The CheckServerConnection function
- Sends a request to the CPanel server to check the server connection.
Getting statistics from the CPanel server
The GetStats function
- Sends a request to the CPanel server (traffic usage statistics over the previous month is collected).
- Sends a request to the database that returns the full traffic statistics that has been already collected in the billing. The difference between the data returned by the server and those in the base is calculated and recorded.
Additional information
Use the fix function to update the information. Log file : /usr/local/ispmgr/var/cpcpanel.log.
