<?php
$username = $_POST[username];
$email = $_POST[email];
$passwd = $_POST[password1];
$passwd2 = $_POST[password2];
$domain = $_POST[domain];
$package = $_POST[package];
$notify = $_POST[notify];
include '../config/config.php';
include '../protocol/httpsocket.php';
$Socket = new HTTPSocket;
$Socket->connect($siteurl,$siteport);
$Socket->set_login($adminusername,$adminpassword);
// {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_API_ACCOUNT_USER',
array(
'username' => $username, // The User's username. 4-8 characters, alphanumeric
'email' => $email, // A valid email address
'passwd' => $password1, // The User's password. 5+ characters, ascii
'passwd2' => $password2, // Password double check. 5+ characters, ascii
'domain' => $domain, // A valid domain name in the form: domain.com
'package' => $package, // One of the User packages created by the Reseller
'ip' => $ipaddress, // One of the ips which is available for user creation. Only free or shared ips are allowed.
'notify' => $notify, // 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['text']}<br />{$result['details']}";
} else {
// new user added.
print_r('User '.$username.' created...');
}
?>