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

    Question Retrieve doc root for domain

    I am working on a custom plugin for cPanel and need to retrieve the doc root based on the domain selected in a dropdown list.

    After looking through the source of the cPanel core files, I found out how it is done in the File Manager popup:

    Code:
    cpanel_api2(docrootcallback,'DomainLookup','getdocroot','domain',domain);
    I have got it to work using javascript, but I would like to use the same call using <?cp ?> tags for better compatibility.

    I tried the following to no avail:

    Code:
    <?cp DomainLookup::getdocroot(%,domain) domain='mydomain' ?>
    I can't find this module or function in the API docs so I don't really know the name of the return variable.

    Does anyone have a clue how to accomplish this? Also, I find the API docs very limited. Seems like a lot of functions are missing?!

  2. #2
    Member
    Join Date
    Aug 2008
    Posts
    37

    Default

    I have solved this.

    If anyone is interested in the solution, here it is:

    Code:
    /xml-api/cpanel/?xmlin=<cpanelaction><apiversion>2</apiversion><module>DomainLookup</module><func>getdocroot</func><args><domain>yourdomain.com</domain></args></cpanelaction>
    By the way, is there a place where all the API functions are listed, or are we supposed to find them ourself by looking at the source code? A complete API doc would be great.

Similar Threads & Tags
Similar threads

  1. edit main domain doc root in vhost.default
    By mindaugas in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 01-31-2009, 05:23 AM
  2. Parked Domain - change domain root?
    By Lumic in forum New User Questions
    Replies: 5
    Last Post: 02-11-2008, 05:56 PM
  3. Park Domain & Domain Root
    By pije in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 07-17-2007, 08:27 AM
  4. I lost my WHM password (root)..how do I retrieve it?
    By dwh2 in forum cPanel and WHM Discussions
    Replies: 5
    Last Post: 07-07-2007, 07:55 AM
  5. Apache Default doc root
    By easyhttp in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-26-2004, 01:07 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube