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.

Cpanel::Accounting (Perl)

Discussion in 'General Discussion' started by david93244, Mar 25, 2004.

  1. david93244

    david93244 Registered

    Mar 18, 2004
    Likes Received:
    Trophy Points:
    I'm on cPanel as a reseller and trying to setup my signup script. When I go to add an account that is already added $whm->{error} doesn't return any thing as far as I can tell. If the account isn't already setup it does get setup.

    BEGIN {
    push (@INC,"/usr/local/cpanel");
    use Cpanel::Accounting;
    my($whm) = Cpanel::Accounting->new;
    $whm->{host} = "localhost";
    $whm->{user} = "<user here>";
    $whm->{accesshash} = '<hash here>"';
    $whm->{usessl} = 1;

    $response = $whm->showversion();
    print "<h1>version: $response</h1>";
    # returns 9.1.0

    $response = $whm->createacct("<domain here>","<new user name here>","<new user password here>","<plan here");
    if ( $whmError ne "") { # why doesn't this error test work
    print "<h1>There was an error while processing your request: Cpanel::Accounting returned [$whmError]</h1><p>";
    print "</div></center></body></html>";

    originally $whm->{error} was in the if, I moved it out to see if muliple calls to it may have been affecting difference as far as I can tell.

    When logged into WHM the upper right corner has this version info: WHM 9.1.0 cPanel 9.1.0-S93 RedHat 7.3 - WHM X v2.1.2

    Any help would be appreciated, I'm tired of customers having to wait for me to enter data manuelly for an account. It's bad customer service.


Share This Page