#1 (permalink)  
Old 11-22-2006, 12:00 PM
Registered User
 
Join Date: Jun 2006
Location: Earth
Posts: 5
hb-travisbell is on a distinguished road
cPanel/WHM API?

Hey guys, nice and simple question.

Is there an API for cPanel/WHM? I couldn't seem to find anything on the forums or in the documentation.

Thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 11-25-2006, 04:35 PM
Registered User
 
Join Date: Jun 2006
Location: Earth
Posts: 5
hb-travisbell is on a distinguished road
Nothing guys?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 11-26-2006, 06:42 PM
Registered User
 
Join Date: Jul 2005
Posts: 23
freakin'me is on a distinguished road
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.*/
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:41 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© cPanel Inc