Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

addondomain details API

Discussion in 'cPanel Developers' started by shijilts, Mar 31, 2009.

  1. shijilts

    shijilts Member

    Joined:
    Aug 3, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    I want to write a script in perl that runs in the server such that whenever a
    user create a new addon domain or subdomain from his cpanel I should be able to write it to a file with the following details.

    subdomain name
    addon domain name
    user who created the addon domain
    document root of the new addon domain

    Please point out the easiest way by which I can pass the variables to my perl
    script.

    I searched for API and found

    <?cp AddonDomain::addaddondomain('% %',result,reason) newdomain=$FORM{'domain'},dir=$FORM{'dir'},subdomain=$FORM{'user'},pass=$FORM{'pass'} ?>

    and how can I make use or the details from the FORM to pass into my scripts variables.

    I find this is commented in x3 theme but when I have deleted this code from doaddondomain.html addon domain is not getting created. So somehow this function is called by cpanel while adding addondomains.

    Any help would be greatly appreciated.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Are you trying to do this for logging purposes? Or do you want to use this information as part of some other programming you are doing?
     
  3. MattDees

    MattDees Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. shijilts

    shijilts Member

    Joined:
    Aug 3, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    151
    Thanks Matt and David for your assistance, hooks did the trick for me.
     
  5. pakogah

    pakogah Member

    Joined:
    Nov 6, 2008
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    51
    @shijilts,
    can I know the hooks name you use to run your script when cpanel add/delete user domain, addon domain, park domain???
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice