
testlink =“ admin.php?m =应用&a = ping&inajax = 1&url = http%3A%2F%2F192.168.0.89%3A5635&ip =&appid = 3&random = 14230” <
响应此链接的功能是/admin/app.php /
中的onping功能
此功能的功能是访问在配置应用程序时添加的参数. 通常情况下,这个地方的网址是

: 5619 / api / uc.php?代码= 28b4P9649Mub1wWGejarHl214enhA2Xt7vLkJPBskk50AwqDza8Ehx0T5%2FNwGtsBdB%2BmZ%2FTCibQ
此代码是一个加密的字符串,
代码将在api / uc.php中解码,基本上就是这样的字符串
操作=测试和时间= 1321131313

包含两个参数,即调用的函数和调用的时间,因此只有返回值为1,通信才能成功
$get = $post = array();
$code = strval(@$_GET['code']);
parse_str(uc_api_x_authcode($code, 'DECODE', UC_KEY), $get);
$timestamp = time();
if (empty($get))
{
die('Invalid Request');
} elseif ($timestamp - $get['time'] > 3600)
{
die('Authracation has expiried');
}
$action = $get['action'];
$post = xml_unserialize(file_get_contents('php://input'));
if (in_array($get['action'], array(
'test',
'renameuser',
'synlogin',
'synlogout',
'updatepw',
))
)
{
$funcname = "uc_api_{$get['action']}";
if (function_exists($funcname))
{
exit($funcname($get, $post));
}
}
exit(API_RETURN_FAILED);
/* communicate with ucenter */
function uc_api_test($get, $post) {
return API_RETURN_SUCCEED;
}
/**/
查看服务器已执行的操作. 每次您打开应用程序列表时,都要遍历该应用程序并将测试发送到该应用程序. 该功能在
Ucenter的control / admin / app.php中的onping()函数

if($app['extra']['apppath'] && @include $app['extra']['apppath'].'./api/'.$app['apifilename']) {
$uc_note = new uc_note();
$status = $uc_note->test($note['getdata'], $note['postdata']);
} else {
$this->load('note');
$url = $_ENV['note']->get_url_code('test', '', $appid);
//die($url);
//var_dump($_ENV['app']);die();
$status = $_ENV['app']->test_api($url, $ip);
}
如果调用返回的结果为1,则表示显示成功,否则显示失败ucenter 应用管理 通信失败,则test_api位于模型/ app.php文件中
function test_api($url, $ip = '') {
$this->base->load('misc');
if(!$ip) {
$ip = $_ENV['misc']->get_host_by_url($url);
}
if($ip < 0) {
return FALSE;
}
return $_ENV['misc']->dfopen($url, 0, '', '', 1, $ip);
}
转到misc.php中调用dfopen函数

dfopen函数使用php的基础函数fsockopen与程序进行通信ucenter 应用管理 通信失败,并将通信结果返回给onping函数. 如果为1,则说明通信成功,否则将失败.
为了方便调试,我们可以在dfopen中记录信息并将输入和输出值记录到文件中,
error_log("[uc_server]\r\nurl: $url\r\npost: $post\r\n\r\n", 3, 'c:/log/php_fopen.txt');
版权声明: 本文的内容由Internet用户自发贡献. 版权归作者所有. 社区不拥有所有权,也不承担任何法律责任. 如果您发现该社区存在涉嫌窃,请发送电子邮件至yqgroup@service.aliyun.com进行举报并提供相关证据. 验证后,社区将立即删除涉嫌侵权的内容.
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/ruanjian/article-174212-1.html
中国捍卫自身主权和海洋权益的立场坚定不移
最后的茜的镜头鸡皮疙瘩都起来了好美