The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WHM Api question

Discussion in 'General Discussion' started by Grooby, Aug 12, 2005.

  1. Grooby

    Grooby Active Member

    Joined:
    May 26, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    Hello there,

    Just started to play with WHM api, and i got one question.
    I found on cpanel website sample php using accounting module:

    Code:
     
    <?php
    
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "localhost";
    $user = "";
    $accesshash = '';
    
    $accts = listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs = listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);
    ?>
    
    From where i may get $accesshash value? does it base64 encoded password to $user or something?

    Adam
     
  2. webignition

    webignition Well-Known Member

    Joined:
    Jan 22, 2005
    Messages:
    1,880
    Likes Received:
    0
    Trophy Points:
    36
    This is generated from within WHM.

    WHM > Cluster/Remote Access > Setup Remote Access Key

    The wording if the menu options may be slightly different depending on your version of WHM/Cpanel, but that's the gist of it.
     
  3. Grooby

    Grooby Active Member

    Joined:
    May 26, 2005
    Messages:
    29
    Likes Received:
    0
    Trophy Points:
    1
    So before running any script i must setup this key and place it in script?

    Is there any more examples of WHM api ? like databases manipulation, ftp etc.. ?

    Adam
     
  4. SethW

    SethW Registered

    Joined:
    Aug 5, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    You will only need to set up your Remote Access key one time and place it in the script. You are also not just choosing any user it needs to be a reseller. You can add thoes kinds of things to the accounting.inc.php

    Thanks
    Seth
     
Loading...

Share This Page