Page 1 of 3 123 LastLast
Results 1 to 15 of 35

Thread: CPanel : Account Creation Module (Remote Access Key)

  1. #1
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default CPanel : Account Creation Module (Remote Access Key)

    Has anyone had any luck getting this to work? I have successfully got it to list accounts, list packages etc. However, no matter what I have tried, for the life of me I can't get it to create new accounts. I am using the PHP version (not Perl). The command I am using is:

    [quote:c3a155c06a]createacct ($host,$user,$accesshash,$acctdomain,$acctuser,$acctpass,$acctplan,$usessl,0);[/quote:c3a155c06a]

    Is this correct? and secondly, if not what command should I be using?

    No error is returned, it just doesn't make the account.

    I have of course got all the variables such as &$acctdomain& set. I am just not sure if the command above is correct or not.

    Any help would be appreciated

  2. #2
    Member
    Join Date
    Jun 2002
    Location
    UK
    Posts
    152

    Default

    the correct way to do it is:
    createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);
    make sure that usernames dont have numbers or are longer than 8 characters, mail me if you have any other problems

  3. #3
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default

    Thanks for your help, I got a bit further. However now I get the error &Unable to find a ip address&. When I create an account via WHM it works fine.

  4. #4
    Member
    Join Date
    Jun 2002
    Location
    UK
    Posts
    152

    Default

    ive never had this problem before, make sure that when creating your packages you have setup the IP address of an account on that package, i.e. whether it has its own IP address or is on the main server IP

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default

    Yeah, I have done that, IP Address is set to &No&.

  6. #6
    Member
    Join Date
    Jun 2002
    Location
    UK
    Posts
    152

    Default

    really not sure then sorry, you will have to email your hosting company for support

  7. #7
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Default

    [quote:54877c9936][i:54877c9936]Originally posted by jimcarter[/i:54877c9936]

    ive never had this problem before, make sure that when creating your packages you have setup the IP address of an account on that package, i.e. whether it has its own IP address or is on the main server IP[/quote:54877c9936]

    I am having the same problem, by setup the IP address, I assume you just mean put a 'n' in the package string.

    Could you either confirm this or post the createacct string that works for you.

    Thanks

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default

    I am not using the sting, what I have done is, setup a &package& via WHM, then where it asks you for the package you want to use, I have filled in &user_packagename&. When I used the package string it didn't work at all and returned errors such as &Unrecognised package& etc.

    If anyone has any has ideas regarding this problem, I am open to suggestions

  9. #9
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Default

    Rochen,
    My reply was actually intended for jim. I don't have the option to create packages, but even so I seem to have got stuck at the same point as you.

  10. #10
    Member
    Join Date
    Jun 2002
    Location
    UK
    Posts
    152

    Default

    I havent been able to find any documentation on this problem so far sorry,
    the following is how I create my accounts through PHP:

    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = &localhost&;
    $user = &username&;
    $accesshash = &myaccesshash173644684&;

    $usessl = &1&;

    $acctdomain = &testdomain.com&;
    $acctuser = &username&;
    $acctpass = &pass&;
    $acctplan = &user_Basic&;
    createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);


    try doing this in a single script before you start doing it with variables posted in forms, let me know how you get on

  11. #11
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default

    Jim - Does your script work for you?

  12. #12
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Default

    Thanks for getting back to me jim

    I don't have the option to create packages, but I just ran it using one of the predefined packages and it worked.

    Either I will have to try to figure out how to send the package string or use the work around of:

    $response = join(&&, file(&http://& . $user . &@& . $whm_server . &:& . $whm_port . &/scripts/wwwacct?& . $request));

  13. #13
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Mar 2002
    Posts
    33

    Default

    How did you get round the problem of the &Unable to obtain IP& ?

  14. #14
    Member
    Join Date
    Jun 2002
    Location
    UK
    Posts
    152

    Default

    mort just managed to create a new account with the code what I just posted, also mort, to list the package names available you can just put in the following:

    $pkgs = listpkgs($host,$user,$accesshash,$usessl);


    foreach($pkgs as $key =& $value) {
    print_r($key);
    echo &&br&&;
    }
    that will list just the names
    if you want the package details just use the following:-


    $pkgs = listpkgs($host,$user,$accesshash,1);


    $plan = &user_Basic&;

    echo &&h4&Hosting Package Details&;
    echo &&br&Package: $plan&br&IP Address: &.$pkgs[$plan][0].& &br&&;
    echo &CGI Access: &.$pkgs[$plan][1].& &br&&;
    echo &Web Space: &.$pkgs[$plan][2].& &br&&;
    echo &Frontpage Extensions: &.$pkgs[$plan][3].& &br&&;
    echo &Control Panel Theme: &.$pkgs[$plan][4].& &br&&;
    echo &FTP Accounts: &.$pkgs[$plan][5].& &br&&;
    echo &Databases: &.$pkgs[$plan][6].& &br&&;
    echo &E-mail Accounts: &.$pkgs[$plan][7].& &br&&;
    echo &E-mail Lists: &.$pkgs[$plan][8].& &br&&;
    echo &Subdomains: &.$pkgs[$plan][9].& &br&&;
    echo &Bandwith: &.$pkgs[$plan][10].& &br&&;
    echo &SSH Shell: &.$pkgs[$plan][11].& &br&&;
    echo &Parked Domains: &.$pkgs[$plan][12].& &br&&;
    echo &Addon Domains: &.$pkgs[$plan][13].& &br&&;
    hope this helps

  15. #15
    Registered User
    Join Date
    Jun 2002
    Posts
    4

    Default

    Thanks Jim,
    It does work if I use the predefined packages, but I need to be able to use it with package strings, maybe it's just not designed to accept package strings.

    Thanks for the posts anyway.

Page 1 of 3 123 LastLast

Similar Threads

  1. Where does cpanel store the whm remote access key?
    By DWHS.net in forum cPanel & WHM Discussions
    Replies: 1
    Last Post: 01-12-2011, 05:09 PM
  2. curl, cPanel API and server remote access key question
    By sharmaine001 in forum Security
    Replies: 1
    Last Post: 01-25-2010, 01:49 PM
  3. Replies: 2
    Last Post: 08-25-2009, 05:33 PM
  4. CPanel remote access key
    By Storagedump.com in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 07-01-2005, 11:29 PM
  5. account creation, remote access PHP, catching errors
    By JamieD in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 01-21-2005, 05:59 AM