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.

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:
    1
    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,279
    Likes Received:
    8
    Trophy Points:
    38
    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 cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
  4. shijilts

    shijilts Member

    Joined:
    Aug 3, 2004
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    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:
    1
    @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