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.

change Package with remote access, is it possible?

Discussion in 'General Discussion' started by kgp43, Nov 20, 2004.

  1. kgp43

    kgp43 Active Member

    Joined:
    Aug 25, 2004
    Messages:
    31
    Likes Received:
    0
    Trophy Points:
    6
    Hi,

    I create new account using "Remote Access". I would like to change plan/package this way too, is it possible?
     
  2. elleryjh

    elleryjh Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    479
    Likes Received:
    0
    Trophy Points:
    16
    Using PHP:

    Include the standard Accounting.php.inc file, then add this code to the script that does the upgrade

    PHP:
    <?php

    function changepackage($host,$user,$accesshash,$usessl$username,$package) {
            
    $result whmreq("/scripts2/upacct?user=${username}&pkg=${package}",$host,$user,$accesshash,$usessl);
            if (
    $cpanelaccterr != "") { return; }
            return 
    $result;
    }
    ?>
    Now you will be able to use the fuction like this, similar to the way you use the creation function
    changepackage("locahost", "reselleracct", "ik0832hhfh", 1, "someuser", "Platnum")

    If you use Perl, the process is similar.
     
Loading...

Share This Page