Hi their complete newbie with Cpanel stuff so bare with me.
I'm going to be offing a web based service. All I'm tring to determine is when the account gets created, how do I run a either a PHP script or the API Calls to automagically create a, db, copy source dir. to dest dir. for site and insert the sql into the new db.
I'm not tring to create actual plugin as this will be used as a per customer basis. My office staff will be using AccountLabPlus to manage Account creation, Suspension, and Kill, I just want cpanel to setup run this task on creation only.
Here is where I stand so far:
Step 1 -
postwwwacct - I realize I have to append something here (maybe) to start the execution or
I create a script of somesort and stick in the scripts dir?
I found this however it's for creating a addon I assume?
Creating a new cPAddon Script
Also I assume I would name the script with post/pre to have it execute either before/after the creation?
This is the most confusing part to me.
Either via API calls or php script execute the following:
Step 2 -
Fileman::dofileop(/srv, ,/home/user/public_html,copy) // Attempting to copy source dir to destination dir.
Will this work ? (my syntax may be wrong)
Step 3 -
Mysql::adddb(mydb) ; // create db
Mysql::adduser(dba,pwd); //create db user
Mysql::adduserdb(mydb,dba,all); // add user to db and grant ALL rights
Step 4 -
Run insert script to pouplate Database
My plan was going to have the sql file stored on the server and run a include/ require_once statement after step 3 is completed to execute the insert. Would this work?
Once completed do I end up with a 1 page script that in placed in the scripts directory, that calls/executes everything.
Sorry for the story tring to be specific as possible.
Thanks for any help in advanced.
I'm going to be offing a web based service. All I'm tring to determine is when the account gets created, how do I run a either a PHP script or the API Calls to automagically create a, db, copy source dir. to dest dir. for site and insert the sql into the new db.
I'm not tring to create actual plugin as this will be used as a per customer basis. My office staff will be using AccountLabPlus to manage Account creation, Suspension, and Kill, I just want cpanel to setup run this task on creation only.
Here is where I stand so far:
Step 1 -
postwwwacct - I realize I have to append something here (maybe) to start the execution or
I create a script of somesort and stick in the scripts dir?
I found this however it's for creating a addon I assume?
Creating a new cPAddon Script
Also I assume I would name the script with post/pre to have it execute either before/after the creation?
This is the most confusing part to me.
Either via API calls or php script execute the following:
Step 2 -
Fileman::dofileop(/srv, ,/home/user/public_html,copy) // Attempting to copy source dir to destination dir.
Will this work ? (my syntax may be wrong)
Step 3 -
Mysql::adddb(mydb) ; // create db
Mysql::adduser(dba,pwd); //create db user
Mysql::adduserdb(mydb,dba,all); // add user to db and grant ALL rights
Step 4 -
Run insert script to pouplate Database
My plan was going to have the sql file stored on the server and run a include/ require_once statement after step 3 is completed to execute the insert. Would this work?
Once completed do I end up with a 1 page script that in placed in the scripts directory, that calls/executes everything.
Sorry for the story tring to be specific as possible.
Thanks for any help in advanced.