时间:2021-07-01 10:21:17 帮助过:12人阅读
function onping() {
$ip = getgpc('ip');
$url = getgpc('url');
$appid = intval(getgpc('appid'));
$app = $_ENV['app']->get_app_by_appid($appid);
$status = '';
if($app['extra']['apppath'] && @include $app['extra']['apppath'].'./api/'.$app['apifilename']) {
echo 'in if='.$app['extra']['apppath'].'./api/'.$app['apifilename'];
$uc_note = new uc_note();
$status = $uc_note->test($note['getdata'], $note['postdata']);
} else {
echo 'in else';
$this->load('note');
$url = $_ENV['note']->get_url_code('test', '', $appid);
$status = $_ENV['app']->test_api($url, $ip);
}
if($status == '1') {
echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "'.$this->lang['app_connent_ok'].'";testlink();';
} else {
echo 'document.getElementById(\'status_'.$appid.'\').innerHTML = "'.$this->lang['app_connent_false'].'";testlink();';
}
}
?>
error_reporting(0);
define('UC_CLIENT_VERSION', '1.5.1');
define('UC_CLIENT_RELEASE', '20100501');
define('API_DELETEUSER', 1); //用户删除 API
define('API_RENAMEUSER', 1); //用户改名 API
define('API_GETTAG', 1); //获取标签 API
define('API_SYNLOGIN', 1); //同步登录 API
define('API_SYNLOGOUT', 1); //同步登出 API
define('API_UPDATEPW', 1); //更改用户密码
define('API_UPDATEBADWORDS', 1); //更新关键字列表
define('API_UPDATEHOSTS', 1); //更新域名解析缓存
define('API_UPDATEAPPS', 1); //更新应用列表
define('API_UPDATECLIENT', 1); //更新客户端缓存
define('API_UPDATECREDIT', 1); //更新用户积分
define('API_GETCREDITSETTINGS', 1); //向 UCenter 提供积分设置
define('API_GETCREDIT', 1); //获取用户的某项积分
define('API_UPDATECREDITSETTINGS', 1); //积分设置
define('API_RETURN_SUCCEED', '1');
define('API_RETURN_FAILED', '-1');
define('API_RETURN_FORBIDDEN', '-2');
define('HDWIKI_ROOT', substr(dirname(__FILE__),0,-4));
define('UC_CLIENT_ROOT',HDWIKI_ROOT.'/api/uc_client/');
define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc());
require_once HDWIKI_ROOT.'/api/ucconfig.inc.php';
$get = $post = array();
$code = @$_GET['code'];
parse_str(authcode($code, 'DECODE', UC_KEY), $get);
if(MAGIC_QUOTES_GPC) {
$get = _stripslashes($get);
}
$timestamp = time();
if(empty($get)){
exit('Invalid Request');
}elseif($timestamp - $get['time'] > 3600){
exit('Authracation has expiried');
}