Help - Search - Members - Calendar
Full Version: Automatic creation of accounts on cPanel
The Planet Forums > Control Panels > cPanel/WHM
dynasyn
I have been doing a lot of reading in these forums and on other forums about cPanel and still have one nagging question. We want to be able to set up our site so when a user applies for an account it is automatically generated and they have instant access to it. We are currently using Ensim but have not been able to successfully set this up. Does cPanel have this option and how easy is it to get it to work?
TheGenie
It's very easy to be done with cPanel using PHP or Perl. Here is a php function example:

[PHP]
function add_new_site($email, $dom, $us, $pass, $pk_id) {
global $host; global $user; global $accesshash; global $usessl;
require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
$do = createacct ($host,$user,$accesshash,$usessl,$dom,$us,$pass,$pk_id);
$do = nl2br($do) ;
$sup_mail_sub = "New Hosting Order finish: $dom n" ;
$mail_headers = "From: Some Billing <$some_email_address>rn";
mail($email, $sup_mail_sub, $do, $mail_headers) ;
}
[/PHP]
richyc
If you're after a customer database/billing system with optional (i.e. you can turn it on an off if you want) auto-installs on one or more Cpanel servers: I recommend Autopilot: administration is now a breeze and the only thing we have to bother about concerning new customers is registering their domain names (but the current "task list" for Autopilot has this being available around mid-September).

However, if you want to "hand-code" it (and, to be honest, as a 'hacker' myself I just like doing things like this for the fun of it: note I said 'hacker' and not 'cracker'), then the Cpanel remote access documentation could be your new best friend: if you follow the path of the camel, then the Perl documentation will happily take your hand and show you the way - otherwise if you prefer the integrated HTML method that PHP offers then the PHP documentation will probably be best.

(I swear: I've only had a quarter of a glass of wine so far icon_smile.gif )
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.