Hi,
this is not a question, as you might have thought, but a little insight into how to automatically access functions of Capanel, like creating accounts and accessing accounts.
Cpanel has script(on some servers its class, mainly new ones), which is here
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
on some servers it is Account-class.php.inc, if its a class.
you include this and set up host name and user and access hash for WHM and then you can use any function.
if the file is simple like its not a class. then the following will do
PHP Code:
<?php
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$host = "localhost";
$user = "";
$accesshash = '';
$accts = listaccts($host,$user,$accesshash,0);
print_r($accts);
?>
and if its a class then following would do
PHP Code:
$obj = new accounting();
$obj->host = 'localhost';
$obj->user = 'root';
$obj->accesshash = 'cbff2cf02a6e55b04c9a0eb5d67a6b14
.................................................
75dc188960bb2a008821b34fddf95c02';
$accts = $obj->listaccts();
print_r($accts);
So, both above written scripts will list all the domains hosted on that server.
the only difference is the second one is class based.
hope this helps somebody