If you were looking for the basic way in php here is something you may be able to work with
Code:
require ?/usr/local/cpanel/Cpanel/Accounting.php.inc?;
$host = ?localhost?;
$user = ?root?;
$usessl = 0;
$accesshash = ?AccessHashInOneLongString?;
$domain = ?puranet.co.uk?; //the domain name to use on this account WITHOUT THE WWW.
$username = ?Username?; //the username to use on this account
$password = ?UserPasswordToUse?; // the user accounts password (cpanel pass)
$plan = ?PlanName?; //the package name in WHM you wish to use.
$create = createacct($host,$user,$accesshash,$usessl,$domain,$username,$password,$plan);
//it will show an error message if theres an error, or if it works, itll show the account creation like it does in whm
echo $create;
If I come across something that might be easier to work with I will post it. Let me know if that helps or not.
With the paid version, is all this automated? I dont want to manually add every new account on my WHM.
And does the pay version offer a brand free download?
Thank you again
Currently neither version is fully automated but the user below posted a script that is supposed to do just that.
Quote:
Originally Posted by TCooper
If you were looking for the basic way in php here is something you may be able to work with
Code:
require ‘/usr/local/cpanel/Cpanel/Accounting.php.inc’;
$host = “localhost”;
$user = “root”;
$usessl = 0;
$accesshash = ‘AccessHashInOneLongString’;
$domain = ‘puranet.co.uk’; //the domain name to use on this account WITHOUT THE WWW.
$username = ‘Username’; //the username to use on this account
$password = ‘UserPasswordToUse’; // the user accounts password (cpanel pass)
$plan = ‘PlanName’; //the package name in WHM you wish to use.
$create = createacct($host,$user,$accesshash,$usessl,$domain,$username,$password,$plan);
//it will show an error message if theres an error, or if it works, itll show the account creation like it does in whm
echo $create;
If I come across something that might be easier to work with I will post it. Let me know if that helps or not.
Thank you. I will code this into the free version.
What would the "access hash" be?
In order to create an account via the api you have to have the access key. You find this by logging into whm and go to the section Cluster/Remote Access and click setup Remote Access Key. You will be presented with the current key to allow your script to create the accounts.
In your vHosting script that would need to be in a settings section for users to edit as well as the $user variable which is the whm user they are using to create the account with.
Feel free to contact me via msn which is in my profile here or on my gaming community site which is in my sig. I do have other messengers as well if needed.
I would also suggest to have your script have the option for the admins to restrict users appling for a package to use only a subdomain which could be turned on or off. I personally would restrict users to only a subdomain basically like advertising and such. If that is already an option sorry for posting as I have not installed this yet until the automation is coded but will click install for ya and myself to keep and eye on this.
MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hosting_plans`
(
`title`,
`posts`,
`webspace`,
`transfer`,
' at line 1
Error Number : 1064
Date : Thursday, August 24th 2006 @ 07:18:20 AM
Script : http://skindev.jmfemedia.com/admincp....php?do=do_add
Referrer : http://skindev.jmfemedia.com/admincp...ing.php?do=add
IP Address : **.**.***.**
Username : JMF-John
Classname : vb_database