Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Member
    Join Date
    Jul 2004
    Location
    South africa
    Posts
    15

    Default Extra Script

    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. #2
    Member sawbuck's Avatar
    Join Date
    Jan 2004
    Posts
    1,310
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #3
    Member
    Join Date
    Jul 2004
    Location
    South africa
    Posts
    15

    Default

    Yes but now to get a php script that does the same thing as list accounts,, thats what i am looking for.

  4. #4
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    Apr 2003
    Location
    Houston, TX
    Posts
    350
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Yeah this could actually be quite handy for a quick reference script

  5. #5
    Member
    Join Date
    Jul 2004
    Location
    South africa
    Posts
    15

    Default

    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. #6
    Member
    Join Date
    Jun 2003
    Posts
    280

    Default

    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. #7
    Member
    Join Date
    Jan 2005
    Posts
    10

    Default

    remember people CPanel is written in PERL NOT php

  8. #8
    Member
    Join Date
    Feb 2004
    Posts
    329

    Default

    This is a pretty good start. The documentation can be found at http://cpanel.net/remoteaccess-php.html.




    PHP Code:
    #!/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. #9
    Moderator cPanel Partner NOC Badge dgbaker's Avatar
    Join Date
    Sep 2002
    Location
    Toronto, Ontario Canada
    Posts
    2,773

    Default

    Quote Originally Posted by serv_co_za
    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.

    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.
    Regards,
    David
    Forum Moderator

Similar Threads & Tags
Similar threads

  1. Extra WHM Accounts?
    By ikick in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 06-23-2007, 07:33 PM
  2. Extra 13 megs
    By EcEnSaNe in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-09-2004, 11:18 AM
  3. Extra files
    By $D$2 in forum New User Questions
    Replies: 2
    Last Post: 09-24-2004, 08:22 AM
  4. A user using extra space...
    By nybble in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 08-24-2004, 11:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube