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.

PHP script to up/down grade account

Discussion in 'General Discussion' started by Marquis, Mar 7, 2003.

  1. Marquis

    Marquis Member

    Joined:
    Feb 5, 2003
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Does anyone know the php script to:
    1) upgrade/downgrade an account (Package)
    2) obtain the bandwidth used for a account.
     
  2. andrewhmartin

    andrewhmartin Registered

    Joined:
    Jan 28, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    upgrade / downgrade script

    <?

    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';

    function upgrade ($host,$user,$accesshash,$usessl,$acctuser,$acctplan) {
    $result = whmreq("/scripts2/upacct?user=${acctuser}&pkg=${acctplan}",$host,$user,$accesshash,$usessl);
    if ($cpanelaccterr != "") { return; }
    return $result;
    }

    $host = "localhost";
    $user = "reslleraccountname";
    $accesshash = 'real_big_number';
    $usessl = "0";

    $acctuser = 'account_name_to_modify';
    $acctplan = 'package_name';


    $do = upgrade($host,$user,$accesshash,$usessl,$acctuser,$acctplan);

    ?>


    How do we get this function and others included in the Accounting.php.inc file?
     
  3. WebOnce

    WebOnce Well-Known Member

    Joined:
    May 20, 2004
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Lansing, MI, USA
    I dunno, but I have a copy i've upgraded myself that can add users with IP's and grab available IP's and such... if your intested i'll attach it in a reply...
     
Loading...

Share This Page