Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Oct 2002
    Posts
    23

    Default Account Creation Key

    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. #2
    Member
    Join Date
    Oct 2002
    Posts
    23

    Default

    any help on this? anyone?

  3. #3
    Member
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    184

    Default

    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. #4
    Member
    Join Date
    Oct 2002
    Posts
    23

    Default

    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. #5
    Member
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    184

    Default

    [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. #6
    Member
    Join Date
    Oct 2002
    Posts
    23

    Default

    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. #7
    Member
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    184

    Default

    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. #8
    Member
    Join Date
    Oct 2002
    Posts
    23

    Default

    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. #9
    Member
    Join Date
    Nov 2002
    Location
    Canada
    Posts
    184

    Default

    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.

Similar Threads & Tags
Similar threads

  1. Replies: 7
    Last Post: 07-23-2011, 08:53 PM
  2. Account Creation Limits refers to WHM account or cPanel account?
    By alphareseller in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-01-2011, 07:02 PM
  3. CPanel : Account Creation Module (Remote Access Key)
    By rochen in forum cPanel and WHM Discussions
    Replies: 34
    Last Post: 07-05-2005, 06:00 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube