Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $config_inside = true;
- require("config.php");
- require("httpsocket.php");
- class DirectAdminAPI
- {
- private $sock;
- private function CreateConnection()
- {
- $this->sock = new HTTPSocket;
- if ($da_secure == true)
- $this->sock->connect("ssl://".$da_host, $da_port);
- else
- $this->sock->connect($da_host, $da_port);
- $this->sock->set_login($da_username,$da_password);
- echo "CreateConnection<br />\n";
- }
- public function CreateUser($username, $email, $pass, $domain, $package)
- {
- $this->CreateConnection();
- $this->sock->query('/CMD_API_ACCOUNT_USER',
- array(
- 'action' => 'create',
- 'add' => 'Submit',
- 'username' => $username,
- 'email' => $email,
- 'passwd' => $pass,
- 'passwd2' => $pass,
- 'domain' => $domain,
- 'package' => $package,
- 'ip' => $da_host,
- 'notify' => 'yes'
- )
- );
- $resultt = $this->sock->fetch_parsed_body();
- //echo "ERROR-". $resultt["error"] ."-"; // debug
- if ($result["error"] != "0")
- {
- echo "<b>Error Creating user ". $username ." on server ". $da_host .":<br />\n";
- echo $resultt["text"]."<br />\n";
- echo $resultt["details"]."<br /></b>\n";
- }
- else
- echo "User ". $username ." created on server ". $da_host ."<br />\n";
- echo "CreateUser<br />\n";
- }
- }
- $wocket = new DirectAdminAPI();
- $username = "pizza";
- $pass = "waAWw94";
- $email = "jarno@jfdhosting.nl";
- $domain = "newyorkpizza.nl";
- $package = "Unlimited";
- $wocket->CreateUser($username, $email, $pass, $domain, $package);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement