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.

find user by addon domain

Discussion in 'cPanel Developers' started by b-rad, Sep 8, 2010.

  1. b-rad

    b-rad Registered

    Joined:
    Sep 8, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    Is it possible via the WHM API to find a username if you know an add-on domain in the account?

    Thanks,
    Brad
     
  2. 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
    I think the call you are looking for is the /xml-api/domainuserdata call which you pass a domain and it returns various information about a domain (including the owner).

    This is called in the following fashion:

    /xml-api/domainuserdata?domain=$domain


    I did discover a bug with this in the 11.27.x release of cpanel that caused this functionality not to work with addon domains, but that is being addressed currently.
     
  3. b-rad

    b-rad Registered

    Joined:
    Sep 8, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Yes, that's exactly what I'm looking for. I guess the bug is why I asked the question. How long do you think it would take your team to fix a bug like this? And will it be fixed in 11.26.x cPanel too?

    Thanks,
    Brad
     
  4. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Brad,

    The bug has already been fixed and tests as of 11.27.70. You will find the correct behavior in 11.28. The fix will not be backmerged into 11.26. I do not have an ETA for 11.28; IMHO it will be available in the CURRENT tier very soon (in units of weeks). If you absolutely needed it now, you can find it in NIGHTLY (11.27.74 at the moment), however NIGHTLY is dangerously bleeding-edge and should never be used in a production environment.

    Regards,
    -DavidN
     
  5. b-rad

    b-rad Registered

    Joined:
    Sep 8, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    It works for me now after the upgrade. Thanks. Though I did notice if I search for the www. version of a domain, it will show the "Obtained userdata." status message, but the data inside the userdata tag is empty.

    Thanks,
    Brad
     
  6. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hi Brad,

    I believe the issue is that "www.mydomain.net" is a ServerAlias (in Apache conf) for "mydomain.net" and the function will only look for domains and subdomains (ServerName) for which there is a corresponding cPanel account (owner).

    Were you able to pass "www.mydomain.net" in an eariler version of cPanel?

    Regards,
    -DavidN
     
  7. b-rad

    b-rad Registered

    Joined:
    Sep 8, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi David,

    I guess that may be it. I haven't used the command before cpanel 11.27.x, so I don't know if it did work previously. I guess I can just do some preprocessing and strip the subdomain from the hostname before the api call.

    Thanks,
    Brad
     
Loading...

Share This Page