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.

Extra Script

Discussion in 'General Discussion' started by serv_co_za, Jan 15, 2005.

  1. serv_co_za

    serv_co_za Member

    Joined:
    Jul 18, 2004
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South africa
    Hello,

    Is there a way to make a php script that list all the clients on my server.

    And maybe more information like how big there hosting is and so on.

    Thank you
     
  2. sawbuck

    sawbuck Well-Known Member

    Joined:
    Jan 18, 2004
    Messages:
    1,367
    Likes Received:
    5
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Not exactly a direct answer to your question but much of that information is available thru WHM in the List Accounts function - at least quota and space used.
     
  3. serv_co_za

    serv_co_za Member

    Joined:
    Jul 18, 2004
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South africa
    Yes but now to get a php script that does the same thing as list accounts,, thats what i am looking for.
     
  4. DomineauX

    DomineauX Well-Known Member
    PartnerNOC

    Joined:
    Apr 12, 2003
    Messages:
    414
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Yeah this could actually be quite handy for a quick reference script
     
  5. serv_co_za

    serv_co_za Member

    Joined:
    Jul 18, 2004
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    South africa
    What i want is to have a list of all my clients ( whm list accounts ) so that every one can see who i am hosting.

    I think it should be a really handle script for alot of people.

    Could some one please help me out on this.

    Thank you.
     
  6. richy

    richy Well-Known Member

    Joined:
    Jun 30, 2003
    Messages:
    276
    Likes Received:
    1
    Trophy Points:
    16
    In "List Accounts" there's a "CSV" option - get the link in the format you want and then use the API interface to fetch a new list and import it into your own database as frequently as you want. I don't think there is a "pre-written" script you can use at this point, so it's a case of write one yourself...
     
  7. ES-207261

    ES-207261 Member

    Joined:
    Jan 1, 2005
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    remember people CPanel is written in PERL NOT php
     
  8. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    This is a pretty good start. The documentation can be found at http://cpanel.net/remoteaccess-php.html.




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


    <?php

    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
    $host "localhost";
    $user "";
    $accesshash '';

    $accts listaccts($host,$user,$accesshash,0);
    print_r($accts);
    $pkgs listpkgs($host,$user,$accesshash,0);
    print_r($pkgs);
    ?>
     
  9. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider

    Unless you know everyone personally, be carefull wanting to advertise that information as you could end up in hot water. Some may not take kindly to you annoucing that they are hosted with you.
     
Loading...

Share This Page