Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Aug 2004
    Posts
    5

    Default addondomain details API

    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. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,720
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    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. #3
    cPanel Staff cPanelMatt's Avatar
    Join Date
    Apr 2005
    Location
    Houston, TX
    Posts
    409

    Default

    This is accomplished via the hooks api, some example code on this can be found at http://www.cpanel.net/support/docs/function-hooks.htm


    all of the code in the second example before the line:

    my $dref = XMLin($xmldoc);

    is generic and can be used with just about any function. after that it's just like working with any other hash from XML::Simple (see: http://search.cpan.org/~grantm/XML-S.../XML/Simple.pm for more info)
    Matt Dees
    Integration Developer
    cPanel, Inc.
    cPanel Integration Blog

  4. #4
    Member
    Join Date
    Aug 2004
    Posts
    5

    Default

    Thanks Matt and David for your assistance, hooks did the trick for me.

  5. #5
    Member
    Join Date
    Nov 2008
    Posts
    16

    Default Re: addondomain details API

    Quote Originally Posted by shijilts View Post
    Thanks Matt and David for your assistance, hooks did the trick for me.
    @shijilts,
    can I know the hooks name you use to run your script when cpanel add/delete user domain, addon domain, park domain???

Similar Threads & Tags
Similar threads

  1. AddonDomain Help with Curl
    By chrislarge305 in forum cPanel Developers
    Replies: 1
    Last Post: 06-08-2010, 08:23 AM
  2. AddonDomain::listaddondomains XML-API issue
    By chrislarge305 in forum cPanel Developers
    Replies: 4
    Last Post: 06-07-2010, 09:30 AM
  3. Problem when adding an addondomain
    By max2009 in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 06-18-2009, 12:30 PM
  4. Addondomain creation variable
    By shijilts in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-30-2009, 04:02 AM
  5. can we add subdoamin for addondomain
    By shann in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 09-21-2002, 02:53 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube