Claus

Registered
Dec 25, 2004
4
0
151
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);
}
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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);
}
I would recommend migrating to the XML-API if you desire more robust functions: http://www.cPanel.net/plugins/xmlapi
 

Claus

Registered
Dec 25, 2004
4
0
151
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...
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
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...
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.