login without password
|$/usr/local/bin/php
<?
$Socket = new HTTPSocket;
$Socket->connect('127.0.0.1',2222);
$Socket->set_login($_SERVER['USER']);
$Socket->query('/CMD_API_SHOW_USER_CONFIG');
$r_query_result = $Socket->fetch_parsed_body();
echo $r_query_result ["quota"];
$tmp=$r_query_result ["quota"];
if ($tmp=='100')
echo 'SUPER, WORKS!!!';
else
echo 'BAD ';
?>
DONE|
Result - BAD
Nothing works without password!
Works only if:
$Socket->set_login($_SERVER['USER'],user_password_here);
Than script inform: SUPER, WORKS!!!
Is any way to decide my task without using password?
l0rdphi1 said:I have updated the communication class to version 2.1, which includes support for DA's new skin login key system.
From within a skin, you may now use the following to login as the code-executing (or "current") user:Remember, this only works within skins.PHP:$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);
Enjoy.
|$/usr/local/bin/php
<?
$Socket = new HTTPSocket;
$Socket->connect('127.0.0.1',2222);
$Socket->set_login($_SERVER['USER']);
$Socket->query('/CMD_API_SHOW_USER_CONFIG');
$r_query_result = $Socket->fetch_parsed_body();
echo $r_query_result ["quota"];
$tmp=$r_query_result ["quota"];
if ($tmp=='100')
echo 'SUPER, WORKS!!!';
else
echo 'BAD ';
?>
DONE|
Result - BAD
Nothing works without password!
Works only if:
$Socket->set_login($_SERVER['USER'],user_password_here);
Than script inform: SUPER, WORKS!!!
Is any way to decide my task without using password?
Last edited: