예제 #1
0
// | WE CAN DO IT JUST FREE
// +----------------------------------------------------------------------
// | Copyright http://bbs.baijiacms.com Licensed under the Apache License, Version 2.0
// +----------------------------------------------------------------------
// | Author: 百家威信 <http://bbs.baijiacms.com>
// +----------------------------------------------------------------------
defined('SYSTEM_IN') or exit('Access Denied');
$alipaythirdlogin = mysqld_select("SELECT * FROM " . table('thirdlogin') . " WHERE enabled=1 and `code`='alipay'");
if (!empty($alipaythirdlogin) && !empty($alipaythirdlogin['id'])) {
    require_once WEB_ROOT . '/includes/lib/alipaySDK/config.php';
    require_once WEB_ROOT . '/includes/lib/alipaySDK/AopSdk.php';
    if (!empty($_GP["auth_code"])) {
        $auth_code = $_GP["auth_code"];
        require_once WEB_ROOT . '/includes/lib/alipaySDK/UserInfo.php';
        $userinfo = new UserInfo();
        $alipay_user = $userinfo->getUserInfo($auth_code);
        if (!empty($alipay_user)) {
            $alipay_openid = $user_info_resp->user_id;
            if (!empty($alipay_openid) && (!empty($_SESSION[MOBILE_ALIPAY_OPENID]) && $_SESSION[MOBILE_ALIPAY_OPENID] != $alipay_openid) || empty($_SESSION[MOBILE_ALIPAY_OPENID])) {
                $nickname = characet($user_info_resp->deliver_fullname);
                $follow = 1;
                $avatar = $user_info_resp->avatar;
                $gender = $user_info_resp->gender;
                $gender = $gender == 'F' ? 2 : ($gender == 'M' ? 1 : 0);
                $fans = mysqld_select("SELECT * FROM " . table('alipay_alifans') . " WHERE alipay_openid=:alipay_openid ", array(':alipay_openid' => $alipay_openid));
                if (empty($fans['alipay_openid'])) {
                    $row = array('nickname' => $nickname, 'follow' => $follow, 'gender' => intval($gender), 'alipay_openid' => $alipay_openid, 'avatar' => '', 'createtime' => TIMESTAMP);
                    mysqld_insert('alipay_alifans', $row);
                    if (!empty($avatar)) {
                        mysqld_update('alipay_alifans', array('avatar' => $avatar), array('alipay_openid' => $alipay_openid));
                    }
예제 #2
0
파일: index.php 프로젝트: tiantuikeji/fy
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<!-- <a href="wap.php?param=msg">发送消息</a><br></br> -->
	<a href="index.php?param=qr">生成二维码</a>
	<br> <a href="index.php?param=follow">获取关注列表</a> <br> <a
			href="index.php?param=gis">获取地理位置</a>
			<br><a href="./wappay/">Wap支付测试</a>
<?php 
if (!empty(HttpRequest::getRequest("auth_code"))) {
    $auth_code = HttpRequest::getRequest("auth_code");
    require_once 'UserInfo.php';
    $userinfo = new UserInfo();
    $userinfo->getUserInfo($auth_code);
}
// if (HttpRequest::getRequest ( "param" ) == "msg"){
// 	$push = new PushMsg ();
// 	$image_text_msg1 = $push->mkImageTextMsg ( "标题,发消息测试", "描述:发消息测试", "http://wap.taobao.com", "", "loginAuth" );
// 	$image_text_msg = array (
// 			$image_text_msg1
// 	);
// 	require_once 'Message.php';
// 	$biz_content = HttpRequest::getRequest ( "biz_content" );
// 	echo "biz_conteng:".$biz_content;
// 	exit();
// 	$msg=new Message($biz_content);
// 	$FromUserId = $msg->getNode ( $biz_content, "FromUserId" );
// 	// 发给这个关注的用户
// 	$biz_content = $push->mkImageTextBizContent ( $FromUserId, $image_text_msg );