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.

Automate account creation tasks

Discussion in 'cPanel Developers' started by Tmike, Jan 21, 2016.

  1. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Hi,

    Currently, for each new domain, this is what i'm doing :

    - Create new account
    - Edit the dns zone of the domaine to add custom A (ns1.thedomaine.com ns2.thedomaine.com)
    - Login to the new created account and create a new Mysql database
    - Create an user for this database
    - Add the rights for this database to this user

    This is what i need to do for each domain and i'm doing this at least 10 times a day.

    Is there any ways to automatise all of that ? Maybe create the zones and database for each new account ?

    The best will be to import a list of domain and doing all of that in auto.

    Any suggestion ?

    Thank you.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    Yes, you could develop a script that utilizes our API and then configure it to run automatically after account creation through a hook. The following documents are a good place to start:

    Guide to UAPI - Software Development Kit - cPanel Documentation
    Guide to Standardized Hooks - Software Development Kit - cPanel Documentation

    Note that some API functions are not yet available as UAPI functions. You can use cPanel API 2 in these cases:

    cPanel API 2 Functions - ZoneEdit::add_zone_record - Software Development Kit - cPanel Documentation

    Thank you.
     
  3. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Already coded and working :) Thank you
     
  4. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    Seems that we can't copy files from an account to another with the api. What is the hook event for account creation ? i can't find it in the doc...

    Thank you
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  6. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
    #6 Tmike, Jan 26, 2016
    Last edited by a moderator: Jan 27, 2016
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  8. Tmike

    Tmike Member

    Joined:
    Jan 21, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Thailand
    cPanel Access Level:
    Root Administrator
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you elaborate on this? For instance, does your custom script authenticate and utilize API functions?

    Thank you.
     
Loading...

Share This Page