How would i do that with the api?
How would i do that with the api?
There are numerous calls that would allow for performing that sort of function. The main one that I can think of off hand would be calling accountsummary with the potential user passed as an argument to it. If you need more info, I can help you out tomorrow.
ListAccounts < AllDocumentation/AutomationIntegration < TWiki
Use that function with searchtype set as domain. You really need to start reading the documentation and stop asking silly questions in the forums![]()
Thanks, Luke Carrier
edgeWeb - the cutting edge web host
Free cPanel 11 hosting now available!
I will try that out, thanks. One more thing, how can i check if a domain is being used by any user?
Sorry for all the questions.
This hasnt been tested, might work though.. 99% sure it will. as its just modified code I use.
PHP Code:$exist = false;
$test_user = "username";
$str = $xmlapi-> listaccts();
$doc = new DOMDocument();
@$doc->loadHTML($str);
$s = @simplexml_import_dom($doc);
$acct = $s->body->listaccts->acct;
foreach($acct as $var => $value){
$user = $value->user;
if($user == $test_user){
$exist = true;
}
}
if(!$exist){
//user doesnt exist
} else {
//user does exist
}