$Socket = new HTTPSocket;
$Socket->connect('127.0.0.1',2222);
$Socket->set_login($_SERVER['USER']);
// $_SERVER['USER'] will always contain the current user's name
$Socket->query('/CMD_API_SHOW_DOMAINS');
$r_ query_result = $Socket->fetch_parsed_body()
print_r($r_query_result);
Yes, actually it does. PHP's "https" is ssl://thoroughfare said:The class doesn't support HTTPS does it?
Matt
$socket = new HTTPSocket;
$socket->connect('ssl://yourserver',2222);
$socket->method('POST'); // this is an optional call; default is GET
$socket->query("/CMD_API_SHOW_USERS",array( 'user' => 'admin' ));
if ($socket->fetch_parsed_body())
{
print_r($socket->fetch_parsed_body());
}
Hmm.. I don't think you can login to DA's API via an email address, but you may be able to at least verify they've got the right email password using PHP's IMAP functions.ctnchris said:is it possible to log someone in using this by their e-mail name and pass for that? I have a staff only section on my irc net page im working on and it would be easier if they could just have one pass for everything, and that way I wouldnt have to make a whole new system.
3DPN said:
- I need to create my form which gathers the user information
The form action should be add_domain.php or whatever it is I am trying to do
make sure I include a call to the httpsocket.php from with in the form action script.
[/list=1]
Is it that simple?
That's useless if you're instancing HTTPSocket (the wrapper only applies to instances of HTTPGetSocket).3DPN said:And what about the wrapper he mentions at the bottom of the post?
<?php
include "httpsocket.php";
$sock = new HTTPSocket;
$sock->connect('myserverip',2222);
$sock->set_login("admin","mypass");
$sock->query('/CMD_API_SHOW_USER_USAGE&user=usernameofaccount');
$result = $sock->fetch_body();
print_r(array_values($result));
?>
<?
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('ssl://myipnumber,'2222');
$sock->set_login('admin','mypasswd');
$sock->query('/CMD_API_SHOW_USER_USAGE?user=ausername');
$result = $sock->fetch_body();
echo $result;
?>
That should be:$sock->query('/CMD_API_SHOW_USER_USAGE&user=usernameofaccount');
$sock->query('/CMD_API_SHOW_USER_USAGE','user=usernameofaccount');
<?
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('ssl://217.170.21.24',2222);
$sock->set_login('admin','myadminpass');
$sock->query('/CMD_API_SHOW_USER_USAGE','user=project14');
$result = $sock->fetch_result();
echo $result;
?>