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.

accounting.php.inc

Discussion in 'General Discussion' started by Claus, May 16, 2008.

  1. Claus

    Claus Registered

    Joined:
    Dec 25, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hello,
    can this function return other fields than domain and user?


    function listaccts ($host,$user,$accesshash,$usessl,$dom) {
    $result = whmreq("/scripts2/listaccts?nohtml=1&searchtype=domain&search=$dom&viewall=1",$host,$user,$accesshash,$usessl);
    if ($cpanelaccterr != "") { return; }

    $page = split("\n",$result);
    foreach ($page as $line) {
    list($acct,$contents) = split("=", $line);
    if ($acct != "") {
    $allc = split(",", $contents);
    $accts[$acct] = $allc;
    }
    }
    return($accts);
    }
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I would recommend migrating to the XML-API if you desire more robust functions: http://www.cPanel.net/plugins/xmlapi
     
  3. Claus

    Claus Registered

    Joined:
    Dec 25, 2004
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    yes I have tried using XML-API but it is slower and harder to organize information, as I used it. I would like to see ip and disk space usage, as extra fields...
     
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hmm, what language are you using to code these scripts? If PHP, specify PHP 4 or PHP 5.

    Note, the older API is no longer being actively maintained. Generally the XML-API is fast with providing responses, hence my inquiry.
     
Loading...

Share This Page