Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    151
    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:
    151
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. WebOnce

    WebOnce Well-Known Member

    Joined:
    May 20, 2004
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    156
    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...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice