include 'httpsocket.php';
$Socket = new HTTPSocket;
$Socket->connect('tdhosting.nl',2222);
$Socket->set_login("adminuser","adminpass");
// {admin_username} and {admin_password} are not specifically your administrative DA user,
// but rather the user that you want to own this new user.
$Socket->query('/CMD_ACCOUNT_USER',
array(
'username' => $user, // The User's username. 4-8 characters, alphanumeric
'email' => $mail, // A valid email address
'passwd' => $pass, // The User's password. 5+ characters, ascii
'passwd2' => $pass1, // Password double check. 5+ characters, ascii
'domain' => $user.".tdhosting.nl", // A valid domain name in the form: domain.com
'package' => 'free', // One of the User packages created by the Reseller
'ip' => '85.92.134.140', // One of the ips which is available for user creation. Only free or shared ips are allowed.
'notify' => 'yes', // yes or no. If yes, an email will be sent to email
'action' => 'create',
'add' => 'Submit'
));
$result = $Socket->fetch_parsed_body();
if ( $Socket->get_status_code() != 200 || !empty($result['error']) )
{
// failure.
echo "Failed to add new user: {$result['error']}<br />{$result['text']}";
exit;
}
foreach($result as $string) {
if(ereg("That username already exists on the system",$string)) {
//username in use
exit;
}
if(ereg("The username is invalid. ",$string)) {
//directadmin returned, username invalid
exit;
}
}
//signup completed