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.

Account Creation Key

Discussion in 'General Discussion' started by azuretek, Nov 1, 2002.

  1. azuretek

    azuretek Member

    Joined:
    Oct 11, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    when I run this script:
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = &localhost&;
    $user = &root&;
    $accesshash = '&My WHM Remote Access Key&;

    $accts = listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs = listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);

    it gives me...
    Array ( [
    Access Denied
    ] =& Array ( [0] =& ) ) Array ( [
    Access Denied
    ] =& Array ( [0] =& ) )

    I tried putting www1.azuretek.com for my host my ip and other things... I made a reseller account and tried the access key but I get the same thing... is there somethin wrong with my cpanel? or is it somethin else?
     
  2. azuretek

    azuretek Member

    Joined:
    Oct 11, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    any help on this? anyone?
     
  3. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    I'll be no help, but I can tell you I'm getting the exact same error. If anyone can help with this problem, it would be greatly appreciated!
     
  4. azuretek

    azuretek Member

    Joined:
    Oct 11, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    since there were no replies...

    I decided to use a script I saw on this site... I modified it to what I needed...

    maybe this can help you

    $host = &azuretek.net&;
    $socket = fsockopen($host,2086);
    $user_whm = &&whm username&&;
    $password_whm = &&whm password&&;
    $authstr = &$user_whm:$password_whm&;
    $pass_whm = base64_encode($authstr);
    $in = &GET scripts/wwwacct?sign=&plan=Free&domain=$sub_domain&username=$username_insert&password=$password_insert&quota=20&cgi=1&maxftp=0&maxpop=3&maxlst=0&maxsql=1&maxsub=0&maxpark=0&maxaddon=0&bwlimit=unlimited&cpmod=free&customip=--Auto+Assign--&msel=n,y,20,n,free,0,1,3,0,0,unlimited,n,0,0,Free HTTP/1.0\r\nAuthorization: Basic $pass_whm \r\n&;

    fputs($socket,$in);
    fclose( $socket );

    this obviously wouldnt be plug and play since you dont have the same plan I do... this can be done for preety much anything you want :) sorry I cant explain step by step... but it is very hard to do it that way :)

    maybe someone else can?
     
  5. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    [quote:50a0999a81][i:50a0999a81]Originally posted by azuretek[/i:50a0999a81]
    $in = &....&customip=--Auto+Assign--&msel=n,y,20,n,free,0,1,3,0,0,unlimited,n,0,0,Free HTTP/1.0\r\nAuthorization: Basic $pass_whm \r\n&;
    [/quote:50a0999a81]
    Thanks for the reply. This is great... I think. ;)

    The only part I don't understand is ...

    ,y,20,n,free,0,1,3,0,0,unlimited,n,0,0,Free HTTP/1.0\r\nAuthorization: Basic $pass_whm

    Would you mind explaining what all this is for?
     
  6. azuretek

    azuretek Member

    Joined:
    Oct 11, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    its the package string :) if you go into your whm goto create new account, view the source, in the area where the little package dropdown menu is, the value of each option is the &package string&

    the HTTP/1.0\r\nAuthorization: Basic $pass_whm part is the authentication, you know when you log into your cpanel or whm it pops up an authentication box, this is giving that the password and stuff
     
  7. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    Hey, I got the Accounting module to work! (Finally)

    Here are some points I've collected from the forums, in no particular order, to get this working:

    - Curl **with SSL** needs to be installed.
    Use /scripts/easyapache from root shell, then choose option 5 (advanced setup). Make sure you go INTO the php section to choose the php build options you want.

    - Path to Accounting.php.inc
    /usr/local/cpanel/Cpanel/Accounting.php.inc

    - $accesshash is the remote access key which is setup through the WHM under Server Setup --& Setup Remote Access Key.
    Be sure to remove the &Begin& and &End WHM Access Key& comment lines.

    - script examples (php & perl) and short documentation on the Accounting module found here: http://www.cpanel.net/docs.htm

    I hope that this can assist people in getting the Accounting module to work, as I've found many threads here asking about it, but none really give a complete solution. I've been at it for hours now. Hopefully it won't take you quite so long... ;)
     
  8. azuretek

    azuretek Member

    Joined:
    Oct 11, 2002
    Messages:
    23
    Likes Received:
    0
    Trophy Points:
    1
    I am planning on getting a certificate sometime soon but I dont think so right now.... so when I get it I will try your way out :)
     
  9. jcsolutions

    jcsolutions Well-Known Member

    Joined:
    Nov 4, 2002
    Messages:
    184
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    You don't need a secure certificate. (Don't ask me why.) I haven't got one installed yet either. Just install the curl with ssl and it should work.
     
Loading...

Share This Page