Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Jun 2006
    Location
    Earth
    Posts
    5

    Default 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!

  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Earth
    Posts
    5

    Default

    Nothing guys?

  3. #3
    Member
    Join Date
    Jul 2005
    Posts
    23

    Default

    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

    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.*/
    ?>

Similar Threads & Tags
Similar threads

  1. cpanel api from WHM
    By broncha in forum cPanel Developers
    Replies: 13
    Last Post: 07-20-2009, 04:59 PM
  2. WHM / cPanel API
    By paulipv in forum cPanel Developers
    Replies: 9
    Last Post: 07-09-2009, 03:30 PM
  3. cPanel / WHM API for PHP5
    By Spiral in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 10-18-2006, 02:54 PM
  4. cPanel/WHM API help
    By webadpro in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 03-02-2006, 03:18 PM
  5. Cpanel/Whm API
    By farshad_s3 in forum cPanel and WHM Discussions
    Replies: 17
    Last Post: 09-17-2004, 01:14 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube