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.

how to create automatic domin parking

Discussion in 'cPanel Developers' started by niroshan, Aug 6, 2007.

  1. niroshan

    niroshan Registered

    Joined:
    Aug 6, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Hi guys,
    Is there any way I can automatically create parked domains using PHP. If anybody knows any script which does this or any body can point me to right direction i`ll be really appreciate it.

    Thanks in advance,
    Regards,
    Niroshan
     
  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
    If I was doing it, I'd call the Cpanel::AddonDomain::addaddondomain API2 function from the XML-API using a PHP script. I don't see an entry for similarly doing something for parked domains; but seeing as how the line between addon and parked domains is now very blurred with version 11, that may not be an issue.

    You can find documentation for all this fun stuff at http://www.cpanel.net/plugins/devel
     
  3. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    I am finding that it is an issue. I am trying this method to add parked domains (of which the customer has no limit), and am getting the error "Sorry, you are not allowed to add any more than (0) addon domains! The domain below was not setup!"

    Is there a function for parked domains?

    Thanks

    Brian
     
  4. 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
    I apologize, the function for adding parked domains is an API1 function:

    Park=park(example.com)

    Where example.com is the domain you wish to park.
     
  5. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    OK. I'm almost there, but still a little rusty. The API2 docs seem to be a little (or a lot) clearer than the API1 docs. I am calling them using the "xml-api/cpanel?" syntax. What is the correct module & function. (I assume that one or the other is "Park").

    Thanks

    Brian

    ETA: I used Park & park for module & function, respectively. The result being the error "This feature is not enabled". Is there something else I should know?
     
    #5 bpmod, Oct 30, 2008
    Last edited: Oct 30, 2008
  6. 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
    /xml-api/cpanel?user=nick&xmlin=<cpanelaction><module>Park</module><func>park</func><apiversion>1</apiversion><args>example.com</args></cpanelaction>

    The above will park example.com on the cPanel account with username: nick.

    As for the error - you have access to WHM, correct? And the cPanel account the domain is being parked upon has the ability to create parked domains, correct?
     
  7. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    Correct on both counts. My syntax is exactly as you have here (including the case-sensitivity, which cost me about three hours this morning on another part of this project).

    Brian
     
  8. 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
    Yeah, the case-sensitivity can be a pain.

    I recommend you let our technical analysts take a look at why this is happening. You can do this by submitting a support ticket.
     
  9. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    I solved it.

    Apparently, if you give an account unlimited parked domains, but the package feature list has no way to administer them, the domains will not be able to be added automatically.

    Is there a way to get this changed?

    Thanks

    Brian
     
  10. mysql_connect

    mysql_connect Member

    Joined:
    Sep 26, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I'm getting the same error:

    Code:
    <?xml version="1.0" ?>
    <cpanelresult><module>Park</module><func>park</func><type>event</type><source>module</source><apiversion>1</apiversion><data><result>This feature is not enabled</result></data></cpanelresult>
    
    I have access to WHM (I'm succesfully adding/deleting/suspending/ etc accounts), the account I want to park the domain on has some parked domains already, the limit for parked domains is 9999 but still doesn't work, same if I set it to "unlimited".

    Any suggestions?
     
  11. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    What does the feature set for the package you have applied to that account look like? For example, if the account or the package allows unlimited parked domains, but you don't have "Parked Domains" enabled in the feature list for that package, you will get that error.

    Hope this helps.

    Brian
     
  12. mysql_connect

    mysql_connect Member

    Joined:
    Sep 26, 2005
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    It allows Parked Domains from cPanel and yes, it's enabled in Feature List.
     
  13. bpmod

    bpmod Well-Known Member

    Joined:
    Sep 23, 2004
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    In that case, I do not know what the problem might be.

    You might try, as cPanelDavidG suggested (to me) in an earlier post, submitting a help ticket.

    Thanks

    Brian
     
Loading...

Share This Page