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.

Script for creating accounts

Discussion in 'General Discussion' started by JWK1291, Sep 20, 2003.

  1. JWK1291

    JWK1291 Registered

    Joined:
    Jul 6, 2003
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Tucson, Arizona
    Hi,

    I need some major help and I need it fast.

    A friend of mine has made a script so one can automatically set an account up.. the following is my submit.php file, and I think I might need a access key.. but, I have no idea how I would insert that.. I have it, but I don't know how to insert it.. the current test is at http://www.pchangout.net/hosting/ this is driving me nuts.. The following is my submit.php, please tell me whats wrong, what to add, or give me a new file :)

    Code:
    <?php 
    	$socket = fsockopen("www.pchangout.net");
    	$authstr = "jesse:hidden_passwrd";
    	$pass = base64_encode($authstr);
    
    	$in = "GET scripts/wwwacct?sign=&plan=jesse_Basic&domain=$newdomain.pchangout.net&username=$newdomain&password=$password&quota=0&customip=--Auto+Assign--&ip=1&cgi=1&frontpage=1&maxftp=unlimited&maxpop=unlimited&maxlst=unlimited&maxsql=unlimited&maxsub=unlimited&maxpark=unlimited&maxaddon=unlimited&msel=n%2Cy%2C500%2Cn%2Cvertex%2Cunlimited%2Cunlimited%2Cunlimited%2Cunlimited%2Cunlimited%2C10000%2Cn%2Cunlimited%2Cunlimited%2Cdefault%2Cjesse_Basic \r\n HTTP/1.0\r\nAuthorization: Basic $pass \r\n";
    	fputs($socket,$in);
    ?>
    Damn you people are slow

    cPanel.net Support Ticket Number:
     
    #1 JWK1291, Sep 20, 2003
    Last edited: Sep 21, 2003
  2. quasiman

    quasiman Member

    Joined:
    Aug 26, 2003
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    Straight out of the WHM Documentation...if you know PHP, it shouldn't be too hard to make it work for your form.

    The Cpanel Accounting PHP module is designed to give applications that use PHP an easy way of manipulating accounts. The general syntax for calling these functions is: function_name ($host,$user,$accesshash,$usessl,$args);

    Example: createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);

    If you are connecting to a remote server you need to set the usessl varible to 1. This module requires the curl+ssl PHP module to be installed.

    Cpanel Accounting supports the following methods:

    showversion - Shows what version of WHM the remote server is running.

    listaccts - Lists currently active accounts.

    listpkgs - Lists packages avalible for creation.

    createacct - Creates a new account on the server.

    killacct - Terminates an account on the server.

    suspend - Suspends an account on the server.

    unsuspend - Unsuspends an account on the server.

    Below is a sample php program.

    #!/usr/local/cpanel/3rdparty/bin/php

    <?php
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host = "localhost";
    $user = "<USERNAME HERE>";
    $accesshash = '<REMOTE ACCESS KEY HERE>';

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

    ?>

    cPanel.net Support Ticket Number:

    cPanel.net Support Ticket Number:
     
  3. temper

    temper Member

    Joined:
    Aug 21, 2001
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
Loading...

Share This Page