php xml api add_addondomain returning false positives?

notionphil

Registered
Feb 17, 2011
4
0
51
Hi All,

I'm using the xml api add_addondomain::addaddondomain function and it's working a little too well.

It successfully adds addon domains that have nameservers pointed to my server - this is working fine.

However, it also reports a success message and adds addon domains when nameservers aren't pointed to my server. These addon domains obviously don't work.

In the below example, the code would return a success even if the nameservers aren't pointed to my server. Additionally the $list_addondomains would contain this incorrectly added addondomain.

Actual result = " 2 UNPOINTEDDOMAIN.com was successfully parked on top of SUBDOMAIN.yyyyyyyy.com 1 1 "

Is this working as intended? Is there any way to check the nameservers of a non-hosted domain? Thanks!

PHP:
$xmlapi = new xmlapi($ip);
	$xmlapi->password_auth("root",$root_pass);
	$xmlapi->set_debug(1);
	$xmlapi->set_output('array');
	$account = "xxxxxxxx";
	$subdomain_string="$subdomain"."yyyyyyyyy.com";

(HERE IS WHERE I REMOVE THE SUBDOMAIN FIRST)


	$add_addondomain= $xmlapi->api2_query($account, 'AddonDomain','addaddondomain', array(dir=>"public_html/$subdomain", newdomain=>"$requestedWebsite", subdomain=>"$subdomain") ); 
	echo"<br />result is ".$add_addondomain[data][result];		
	
$list_addondomains= $xmlapi->api2_query($account, 'AddonDomain','listaddondomains'); //check if addondomain was added
 

notionphil

Registered
Feb 17, 2011
4
0
51
I'm sure there are some CPanel API experts out there who have an idea of what's going on here...anyone?