So I created /usr/local/cpanel/hooks/addondomain/addaddondomain
First thing, I output all the xml stuff that got sent to the script, since it isn't necessarily clear what gets passed to this (I looked at the docs at ApiAddonDomain < ApiDocs/Api2 < TWiki but I also just wanted to make sure.)
It appears ultimately that //newdomain// is the variable that contains the actual addon domain that got created.
I just wanted to double-check that, because the way cPanel creates addon domains, it always also creates a subdomain with that prefix too.
So if my primary domain is cat.domain.com and I create an addon-domain kitten.domain.com, I get the kitten.domain.com in newdomain variable, and not the kitten.cat.domain.com which ends up as one of the values listed in the DOMAINS list in the CPDATA section. Coincidentally (or always?) the value in newdomain appears to be last in the DOMAINS list as well, just as a sanity check for me.
Anyway, just wanted to confirm that indeed newdomain is the FQDN of the domain that's being added. Or at least it's the text that gets entered in the text box in the Addon Domain GUI for the WHM end-user when he clicks on the AddOn Domain icon and fills in all that data (new domain name, subdomai/ftp username, ducment root, etcetc.)
Thank you,
PH
First thing, I output all the xml stuff that got sent to the script, since it isn't necessarily clear what gets passed to this (I looked at the docs at ApiAddonDomain < ApiDocs/Api2 < TWiki but I also just wanted to make sure.)
It appears ultimately that //newdomain// is the variable that contains the actual addon domain that got created.
I just wanted to double-check that, because the way cPanel creates addon domains, it always also creates a subdomain with that prefix too.
So if my primary domain is cat.domain.com and I create an addon-domain kitten.domain.com, I get the kitten.domain.com in newdomain variable, and not the kitten.cat.domain.com which ends up as one of the values listed in the DOMAINS list in the CPDATA section. Coincidentally (or always?) the value in newdomain appears to be last in the DOMAINS list as well, just as a sanity check for me.
Anyway, just wanted to confirm that indeed newdomain is the FQDN of the domain that's being added. Or at least it's the text that gets entered in the text box in the Addon Domain GUI for the WHM end-user when he clicks on the AddOn Domain icon and fills in all that data (new domain name, subdomai/ftp username, ducment root, etcetc.)
Thank you,
PH