There is one included with cPanel, this one is old and buggy however. You can find a little documentation on this API
here. By using the PHP file below, it's possible to view it's sources:
PHP Code:
<?php echo show_source('/usr/local/cpanel/Cpanel/Accounting.php.inc'); ?>
I decided to write one myself, which I do not post here for I do not know exactly if I'm going to freely distribute it, or do it the commercial way. Anyhow, users of this forum can PM me in order to receive a free copy of this script. It has been written fully in PHP5 Object Oriented. I'll post the syntax under here, so you can see whether you're interested.
Freakin'me
Quote:
the working of the next functions is all the same:
- listpkgs () (array) > Returns a list of all packages owned by the reseller
- listaccts () (array) > Returns a list of all accounts (users) owned by the reseller
- showversion () (string) > Returns the current version of cPanel
- suspend ($user) TRUE/FALSE > Suspends (de-activate) a user
- unsuspend ($user) TRUE/FALSE > Unsuspends (activates) a user
- ListSuspend () (array) > returns a list of all suspended accounts
- IsSuspended ($user) TRUE/FALSE > checks if a user is suspended.
- KillAccount ($user) TRUE/FALSE > Removes an user/account. THIS CAN'T BE UNDONE!
- CreateAccount($domain, $user, $password, $package) TRUE/FALSE > Create a new account. Max len username = 8.
- GetQuotas () (array) > List all the diskspace quotums of all users.
- GetBandwidth () (array) > Retrieves a list of all users including the maximum amount of data transfer they're allowed to use.*/
?>
|