resolveit said:Ill work on it tonight and post some code later tonight.
Regards,
Onno
Thanks - thats very kind of you.
resolveit said:Ill work on it tonight and post some code later tonight.
Regards,
Onno
userdomain.com=14.6848:unlimited:1.86753:4.5522:0:no:unlimited:ON:ON:ON:
$listSocket = new HTTPSocket;
$listSocket->connect($siteurl,$siteport);
$listSocket->set_login($adminusername,$adminpassword);
$listSocket->query('/CMD_API_SHOW_USER_DOMAINS',array('user'=>'myuser'));
$listresult = $listSocket->fetch_parsed_body();
print_r($listresult);
Array
(
[userdomain_com] => 14.3521:unlimited:1.86654:4.48669:0:no:unlimited:ON:ON:ON:
)
l0rdphi1 said:
PHP.net:
Note that variables cannot contain a DOT (.) in PHP. So, DOT will be replaced by underscore. e.g. variables like "variable.something" will be converted into "variable_something".
<?php
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('p44.org',2222);
$sock->set_login('admin','passs');
$sock->query('/CMD_API_SHOW_ALL_USERS');
$result = $sock->fetch_parsed_body();
foreach ($result as $user) {
echo "$user <br />";
}
?>
...
foreach ($result as $user) {
echo "$user <br />";
}
...
foreach ($result['list'] as $key => $user) {
echo "$user <br />";
}
$array_headers['Authorization'] = 'Basic '.base64_encode("$this->remote_uname:$this->remote_passwd");
<pre><?
ob_start();
include 'httpsocket.php';
include 'funkcje.php';
polaczenie();
$da = new HTTPSocket;
$da->connect('thc.net.pl','2222');
$da->set_login('admin','***');
$sql = "SELECT login FROM thc_konta WHERE oplacone = '0' AND powiadomiony = '1'";
$r = zapytanie($sql);
while($w = mysql_fetch_assoc($r))
{
$tab = array ('location' => '/CMD_SELECT_USERS',
'suspend' => 'Suspend',
'select' => "$w[login]");
$da->query('/CMD_SELECT_USERS', $tab);
print_r($da);
$rez = $da->fetch_parsed_body();
$r2 = $da -> fetch_body();
echo $r2;
?>
<br><hr><b> <? echo $w[login];?> </b>
<?
print_r($rez);
if( !empty($rez[error]))
{
echo "User ".$w[login]." nadal ma konto<br>";
}
else
{
echo "User ".$w[login]." ma zablokowane konto :-) <br>";
}
}
echo "<br> Lacznie : ".mysql_num_rows($r);
ob_end_flush();
?>
httpsocket Object
(
[version] => 2.3
[method] => GET
[remote_host] => thc.net.pl
[remote_port] => 2222
[remote_uname] => admin
[remote_passwd] => ***
[result] => HTTP/1.1 404 Not found
Server: DirectAdmin Daemon v1.23.1 Registered to Piotr Kloc
Content-Type: text/html
Error: document not found
[result_header] => HTTP/1.1 404 Not found
Server: DirectAdmin Daemon v1.23.1 Registered to Piotr Kloc
Content-Type: text/html
[result_body] => Error: document not found
[bind_host] =>
[error] => Array
(
)
[query_cache] => Array
(
[0] => GET /CMD_SELECT_USERS?location=%2FCMD_SELECT_USERS&suspend=Suspend&select=gigi1990 HTTP/1.0
User-Agent: HTTPSocket/2.3
Host: thc.net.pl:2222
Accept: */*
Connection: Keep-Alive
Authorization: Basic YWRtaW46dGdpNUFwZUY=
[1] => GET //CMD_SELECT_USERS HTTP/1.0
User-Agent: HTTPSocket/2.3
Host: thc.net.pl:2222
Accept: */*
Connection: Keep-Alive
Authorization: Basic YWRtaW46dGdpNUFwZUY=
)
[doFollowLocationHeader] => 1
)
Error: document not found