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.

Unexpected (buggy?) behaviour using the AddonDomain module

Discussion in 'cPanel Developers' started by jason_85, Feb 11, 2011.

  1. jason_85

    jason_85 Member

    Joined:
    Feb 8, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    I've been happily adding domains to my shared hosting cPanel account with hostgator using the cPanel XML API2 modules.

    Today, I naively tried to add 50 addon domains with names like NewTech.info using the addaddondomain function. I parsed the string "NewTech.info" with the capitals. The domains were created just fine, and they appeared in my cPanel account under Addon Domains.

    However, when I tried to create a site, it was as if the domain was never added. When I tried to remove the domain, I received an error, saying that I do not control the domain "newtech.info" (note the lack of capitals).

    Anyway, I realise that I shouldn't have tried to add domains with capitals in them :p, but this behavior in cPanel is quite odd. I don't know of any need to include capitals in domains, so all input domain info should be passed through a function like php's strtolower() in any case. This seems to happen only AFTER the domain has been added to the domain list, so that the user ends up with control over a domain he can't see, and a list of domains without the capitals that he can't control.

    I ended up having to contact support and the admin just deleted them all.

    Should I submit this as a bug somewhere, or is it something particular to my host? I'm with Hostgator shared hosting.
     
  2. 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 jason_85,

    When you tried to remove the addon domain, did you do it in the cPanel interface or via an XML-API call. If you did it via an XML-API call, what port were you using and who where you authenticated as (ie, 'root', a reseller account, or the cPanel end-user account)?

    I don't think the capitals have anything to do with it. I'm pretty sure we just lowercase the input string before we process it.

    I recall seeing something like this in the past put I don't remember the details of the top of my head. If I have a little more detail, I'm sure I can reproduce your scenario and we can figure out what to do from there ;)

    Regards,
    -DavidN
     
  3. jason_85

    jason_85 Member

    Joined:
    Feb 8, 2011
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Sorry for the delay, I totally forgot about this post. If I recall correctly I attempted to remove the domains using both the API, which failed, and then cPanel itself. removing the domain manually resulted in the error I mentioned above.

    I am using shared hosting and use port 2082 to access cPanel. I am not sure how I can find my user type but I certainly don't have an admin role. After changing to lowercase I've never again had problems adding or removing domains.
     

Share This Page