I Have the following perl script that i currently use to make accouts for direct admin you can view this in action @ www.gookaa.com/mail/ (http://www.gookaa.com/mail/)
#!/usr/bin/perl -w
# Read the standard input (sent by the form):
read(STDIN, $FormData, $ENV{'CONTENT_LENGTH'});
# Get the name and value for each form input:
@pairs = split(/&/, $FormData);
# Then for each name/value pair....
foreach $pair (@pairs) {
# Separate the name and value:
($name, $value) = split(/=/, $pair);
# Convert + signs to spaces:
$value =~ tr/+/ /;
# Convert hex pairs (%HH) to ASCII characters:
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
# Store values in a hash called %FORM:
$FORM{$name} = $value;
}
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
print "Content-type: text/html\n\n";
@QUERY_STRING = split (/\&/, $ENV{QUERY_STRING});
foreach $line (@QUERY_STRING) {
( $var, $val ) = split (/\=/,$line);
$val =~ s/(\@|\%40)/\\\@/g;
eval "\$" . $var . " = \"" . $val . "\"\n"; print "<br />";
}
$browser = LWP::UserAgent->new();
$browser->agent('Mozilla/4.76 [en] (Win98; U)');
$browser->cookie_jar({});
push @{ $browser->requests_redirectable }, 'POST';
# change the username, password and ip address to your server information.
$url = '[url]http://USERNAME:PASSWORD@IP:PORT/CMD_EMAIL_POP?DOMAIN=DOMAIN_NAME';[/url]
$response = $browser->post( $url,
[
action => 'create',
add => 'Submit',
user => "$FORM{'user'}",
passwd => "$FORM{'passwd'}",
passwd2 =>"$FORM{'passwd2'}",
quota => '$FORM{'quota}',
]
);
die "Can't access admin tool -- ", $response->status_line
unless $response->is_success;
print $response->content;
I'm not a coder and was woundering if someone can mod the cpanel script to work with direct admin. I can also get the php version of this script from the Direct Admins API.
Thanks