Automating Account Creation

You can write you own script using DirectAdmin's api or buy a billing program such as whoiscart...
 
First thing, Corigo, is probably to check your hosting company; they may have something set up.

Whois.Cart is limited, but easy to install, and once your hosting company sets it up, you can buy a license and use it for your reseller account.

There are others but I don't know if they can be set up for resellers or not.

Jeff
 
I use a perl script from my web site that logs in as admin and then creates the user or reseller. You could do the same as the reseller. You would have the perl script (or php) log in as you and then post the proper field values. I don't know php but here is some sample perl:


use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use HTTP::Cookies;
$ua = new LWP::UserAgent;
$ua->cookie_jar(HTTP::Cookies->new);

$url = "http://ip_address_here:2222/CMD_LOGIN";

$username = "your_reseller_id";
$password = "your_reseller_password";


# This logs you in first

my $req = POST $url,
[ username => $username, password => $password];

@results = $ua->request($req)->as_string;


# The rest creates the account:

$url = "http://ip_address_here:2222/CMD_ACCOUNT_USER";

$action = "create";
$username = "$in{'username'}";
$email = "$in{'email'}";
$passwd = "$in{'password'}";
$passwd2 = "$in{'password'}";
$domain = "domain.com";
$package = "package_name";
$ip = "ip_address";
$notify = "yes";
$add = "Submit";

my $req = POST $url,
[action => $action,
username => $username,
email => $email,
passwd => $passwd,
passwd2 => $passwd2,
domain => $domain,
package => $package,
ip => $ip,
notify => $notify,
add => $add];

@results = $ua->request($req)->as_string;


This is not complete code but it can give one an idea of what needs to be done. Php can do something similar I am sure. The important thing is that the script needs to login first and store the cookie in memory and then create the account. I just viewed the source of the form for DirectAdmin and had the script pass the vairables instead of me having to go to the form and do it.

You can get perl or php scripts to do anything that the DirectAdmin panel can do just by having the script log in first and then post the proper variables and commands.
 
Back
Top