The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php xml api add_addondomain returning false positives?

Discussion in 'cPanel Developers' started by notionphil, Mar 13, 2013.

  1. notionphil

    notionphil Registered

    Joined:
    Feb 17, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    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
     
  2. notionphil

    notionphil Registered

    Joined:
    Feb 17, 2011
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'm sure there are some CPanel API experts out there who have an idea of what's going on here...anyone?
     
Loading...

Share This Page