Currently we do support only cPanel to automatically add the additional domain as addon domain. You can add your own module to support other hosting panels like DirectAdmin.
To create your own provisioning module, open the directory  /modules/addons/addondomain/providers/  and create a directory which has the same name as the WHMCS module.

If you are using the WHMCS server module 'directadmin', create a directory named directadmin and create inside the file  directadmin.php .
Inside this file you must create the function addondomain_addDomain  which will get executed when a client activates a new free domain and his hosting product which uses the defined server module.

Here is an example, File:  /providers/directadmin/directadmin.php 

function addondomain_addDomain ($ProductDetails, $Domain, $ServerDetails) {
    $daUser = $ServerDetails['username'];
    $daHost = $ServerDetails['hostname'];
    $daPassword = $ServerDetails['accesshash'];
    $HostingUsername = $ProductDetails['tblhosting']['username'];

    // $ProductDetails gives you all informations from tblhosting 
    // logActivity (json_encode($ProductDetails));
    // $ServerDetails gives you all WHMCS server informations
    // logActivity (json_encode($ServerDetails));

    $directadmin->addDomain->......;

    // result = success or fail
    // log = api response
    return array('result' => $result, 'log' => $apiresponse);
}

The parameter  $ServerDetails  gives you the server details and $ProductDetails gives you an array with all relevant client product informations.

The return will be logged to the module activity log if you have the WHMCS module log activated.

  • No labels