<?php
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('yoursite.com',2222);
$sock->set_login('{X_username}','{X_password}');
$sock->set_method('POST');
$sock->query('/CMD_DOMAIN',
array(
'action' => 'create',
'domain' => '{X_new_domain}',
'ubandwidth' => 'unlimited',
'uquota' => 'unlimited',
'ssl' => 'ON',
'cgi' => 'ON',
'php' => 'ON',
'create' => 'Create'
));
$result = $sock->fetch_body();
echo $result;
?>
Actually, in place of the above code snip, it may be better to use:l0rdphi1 said:PHP:<?php [...] $sock->set_login('{X_username}','{X_password}'); [...] ?>
<?php
$sock->set_login('admin|{X_username}','{admin_password}');
?>
Sockets::handshake - begin
Sockets::handshake - end
/CMD_API_ACCOUNT_USER
0: Accept-Encoding: gzip,deflate
1: Authorization: Basic XXXXXXX
2: Connection: Keep-Alive
3: Content-Length: 202
4: Content-Type: application/x-www-form-urlencoded; charset=UTF-8
5: Host: XX.8.35.XX:2222
6: User-Agent: Apache-HttpClient/4.5.3 (Java/1.8.0_222)
Post string: add=Submit&password=qrZ2hqNR8ekGCyAU&package=newpackage&domain=1311505852directadmin1.uz&ip=XX.8.35.XX&action=create&password2=qrZ2hqNR8ekGCyAU&plan&email=info%40directadmin1.com¬ify=no&username=user1
auth.authenticated
Plugin::addHooks: start
Plugin::addHooks: end
Command::doCommand(/CMD_API_ACCOUNT_USER)
Dynamic(api=1, error=1):
text='Unable to Create User'
result='The username ,password and email is required'
Command::doCommand(/CMD_API_ACCOUNT_USER) : finished
Command::run: finished /CMD_API_ACCOUNT_USER