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.

automated cPanel creation and access

Discussion in 'cPanel Developers' started by skyfe, Mar 19, 2011.

  1. skyfe

    skyfe Registered

    Joined:
    Mar 19, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hi there,

    What I would like to do is creating cPanel accounts automaticly through my PHP script and automaticly create a database user and database to the just created cPanel account + upload files to it automaticly. Though I have no idea how to do this, could anyone help me out a little? Is there any examples or something to do this?

    Thanks in advanced.

    Best Regards,
    Skyfe.
     
  2. PenguinInternet

    PenguinInternet Well-Known Member
    PartnerNOC

    Joined:
    Jun 20, 2007
    Messages:
    149
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Cardiff, UK
    cPanel Access Level:
    DataCenter Provider
    Twitter:
  3. skyfe

    skyfe Registered

    Joined:
    Mar 19, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    I've had a look into that document already but I did not find any way in PHP to create e.g. database for an account or dynamicly add files 'to an account' using PHP.
     
  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 Skyfe,

    I'd suggest taking a look at this blog article, Frequently Asked Scripts: "How do I automate XYZ after creating an account?" - cPanel Integration . It's primarily geared towards someone who wants to create a postwwwacct script hook. However, there should be plenty of fuel there to get you going since there are many ways that you could automate account creation and other account related actions (like database creation). The XML-API PHP client class will make scripting those calls pretty straight forward (as illustrated in that blog article and in many threads here in the Developer Discussion forum).

    Calls your going to be interested in are:
    1) XML-API createacct
    2) API1 Mysql module
    3) I'll probably use the native PHP ftp or system commands for placing the files you want, as opposed to our API1 Fileman module (which would require you to POST a multi-part HTTP request)

    Let us know if you need anything else!

    Regards,
    -DavidN
     
Loading...

Share This Page