/**
  * 返回登录
  */
 public function callback()
 {
     require_once COMMON_LIB_PATH . "QqConnect/API/qqConnectAPI.php";
     $qc = new QC();
     $callback = $qc->qq_callback();
     $openid = $qc->get_openid();
     $user = K("user")->field("uid,username,password,qqau,userlock,uuid,usergroup")->where(array("qqau" => $openid))->find();
     session("qqau", $openid);
     if (empty($user["qqau"])) {
         //首次登录或没有绑定账号
         $qc = new QC($callback, $openid);
         $arr = $qc->get_user_info();
         session("UserInfo", $arr["nickname"]);
         go("Passport/Qqlogin/index");
     } elseif ($user["qqau"] == $openid) {
         //数据库比对正确
         if ($user["userlock"] == 1) {
             $this->error("您已经被锁定,请联系管理员!");
         }
         //$this->eve_exp($user["uid"]);
         $loginData = array("logintime" => time(), "loginip" => ip::getClientIp(), "qqau" => $openid);
         M("user")->where(array("uid" => $user["uid"]))->save($loginData);
         // p($_POST);
         session("username", $user["username"]);
         session("uid", $user["uid"]);
         session("uuid", $user["uuid"]);
         session("usergroup", $user["usergroup"]);
         $this->success("登录成功!正在跳转...", U(__WEB__));
     }
 }
Example #2
0
 public function callbackAction()
 {
     $mediaqqmodel = new Media_QQModel($this->_basemodel, $this->_qqparam);
     $app_id = isset($_REQUEST['app_id']) ? trim($_REQUEST['app_id']) : '69948denMVMoBujYGLSFGUHbkvP7E3';
     $mediaqq = $mediaqqmodel->getApp($app_id);
     $APPID = $mediaqq['APPID'] && $mediaqq['APPKEY'] ? $mediaqq['APPID'] : $mediaqq['def_APPID'];
     $APPKEY = $mediaqq['APPID'] && $mediaqq['APPKEY'] ? $mediaqq['APPKEY'] : $mediaqq['def_APPKEY'];
     $redirect_uri = $this->_qqparam['redirect_uri'] . '?app_id=' . $mediaqq['app_id'];
     $state = md5($mediaqq['app_key']);
     $qcinit = new QQAPI_YafQQConnetAPI();
     $qc = new QC();
     $access_token = $qc->qq_callback($APPID, $redirect_uri, $APPKEY);
     echo $access_token . '----------';
     $openid = $qc->get_openid($access_token);
     echo $openid . '---------';
     $qqUser = $qc->my_get_userinfo($access_token, $openid, $APPID);
     if ($qqUser && $qqUser->nickname) {
         $media_user_id = $mediaqqmodel->saveUser($openid, $qqUser, $APPID);
         if ($media_user_id) {
             $usertokentime = date('Y-m-d H:i:s', time() + Yaf_Application::app()->getConfig()->application->usertokentime);
             $login_token = $mediaqqmodel->saveAccessToken($app_id, $access_token, $openid, $media_user_id, $usertokentime);
             if ($login_token) {
                 $url = $mediaqq['token_url'];
                 $concat = '&';
                 if (strpos($url, '?') === false) {
                     $concat = '?';
                 }
                 $url .= $concat . "token={$login_token}";
                 header("Location:{$url}");
             }
         }
     }
     exit;
 }
 public function callback()
 {
     es_session::start();
     require_once APP_ROOT_PATH . "system/api_login/qqv2/qqConnectAPI.php";
     $qc = new QC();
     $access_token = $qc->qq_callback();
     $openid = $qc->get_openid();
     $use_info_keysArr = array("access_token" => $access_token, "openid" => $openid, "oauth_consumer_key" => $this->api['config']['app_key']);
     $use_info_url = "https://graph.qq.com/user/get_user_info";
     $graph_use_info_url = $qc->urlUtils->combineURL($use_info_url, $use_info_keysArr);
     $response = $qc->urlUtils->get_contents($graph_use_info_url);
     $arr = array();
     $arr = json_decode($response, true);
     $msg['field'] = 'qq_id';
     $msg['id'] = $openid;
     $msg['name'] = $arr["nickname"];
     es_session::set("api_user_info", $msg);
     $user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where qq_id = '" . $openid . "' and qq_id <> '' and is_effect=1 and is_delete=0");
     if ($user_data) {
         $user_current_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where id = " . intval($user_data['group_id']));
         $user_group = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user_group where score <=" . intval($user_data['score']) . " order by score desc");
         if ($user_current_group['score'] < $user_group['score']) {
             $user_data['group_id'] = intval($user_group['id']);
         }
         es_session::set("user_info", $user_data);
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set login_ip = '" . get_client_ip() . "',login_time= " . TIME_UTC . ",group_id=" . intval($user_data['group_id']) . " where id =" . $user_data['id']);
         es_session::delete("api_user_info");
         app_recirect_preview();
     } else {
         $this->create_user();
         app_redirect(APP_ROOT . "/");
     }
 }
 public function callback()
 {
     require 'QQ/API/qqConnectAPI.php';
     //引进qqapi 接口
     $qc = new \QC();
     $acs = $qc->qq_callback();
     //获取access-token 和openid
     $oid = $qc->get_openid();
     $qc = new \QC($acs, $oid);
     $uinfo = $qc->get_user_info();
     //获取用户信息
     $user = M('user');
     $list = $user->where("openid='" . $oid . "'  and status = 1")->find();
     if ($list) {
         session('userid', $list['id']);
         session('username', $list['nickname']);
         session('userphone', $list['mobile']);
         session('userimg', $list['headpic']);
         //var_dump($list);die();
         echo "<script>window.close();window.opener.location.reload()</script>";
         exit;
         //$this->redirect('Index/index', '', 0, '页面跳转中...');
     } else {
         session('openid', $oid);
         session('uinfo', $uinfo);
         session('sign', array('name' => 'QQ账号', 'code' => 1));
         echo "<script>window.close();window.opener.location.href='" . U('User/threepartlogin') . "'</script>";
         exit;
     }
 }
Example #5
0
 public function qqcallback()
 {
     Vendor('Oauth.QC#class');
     $qc = new \QC();
     $token = $qc->qq_callback();
     $openid = $qc->get_openid();
     if (!$token || !$openid) {
         $this->error('操作失败');
     }
     // 重新实例化 QC类
     $qc = new \QC($token, $openid);
     $uinfo = $qc->get_user_info();
     $this->user_model = D('user');
     $user = $this->user_model->field('id,email,password')->where(array('qq_token' => $token, 'qq_openid' => $openid))->find();
     // echo $this->user_model->getLastSql();
     if ($user['id'] > 0) {
         // 登录用户
         if ($this->user_model->login($user['id'], $user['email'], $user['password'])) {
             //TODO:跳转到登录前页面
             $this->success('登录成功!', session('rebackurl'));
         } else {
             $this->error($model->getError());
         }
     } else {
         session('avatar', $uinfo['figureurl_qq_2']);
         session('openid', $openid);
         session('token', $token);
         session('uname', $uinfo['nickname']);
         session('oatype', 'qq_');
         //print_r($uinfo);
         $this->redirect('join');
     }
 }
 public function callback()
 {
     vendor('QQApi.qqConnectAPI');
     $qc = new \QC();
     $access_token = $qc->qq_callback();
     $openid = $qc->get_openid();
     $data['data'] = serialize(array('access_token' => $access_token, 'openid' => $openid));
     M('post_log')->add($data);
     //注册会员信息
     //查看此openid是否存在
     $map['username'] = $openid;
     $detail = D('User')->where($map)->find();
     $userid = $detail['userid'];
     $nickname = $detail['nickname'];
     if (!$detail) {
         //获取用户信息
         $arr = $qc->get_user_info();
         M('post_log')->add(array('data' => serialize($arr)));
         $info['username'] = $openid;
         $info['nickname'] = $nickname = $arr['nickname'];
         $userid = D('User')->add($info);
     }
     if ($userid) {
         //保存session
         session('userid', $userid);
         //保存cookie用户信息
         cookie('userid', $userid);
         cookie('nickname', $nickname);
         cookie('userid', $userid);
         redirect(U('Shenma/user'));
     }
     /* $arr = $qc->get_user_info();
     		
     		var_dump($arr);exit; */
 }
 public function qqcallback()
 {
     require_once "./QQ/API/qqConnectAPI.php";
     $qc = new \QC();
     echo $qc->qq_callback();
     echo $qc->get_openid();
     var_dump($qc);
 }
Example #8
0
 public function getUserInfo()
 {
     require_once dirname(__FILE__) . "/API/qqConnectAPI.php";
     $qc = new QC(ISession::get('access_token'), ISession::get('openid'), $this->apiId);
     $arr = $qc->get_user_info();
     $userInfo['id'] = ISession::get('openid');
     $userInfo['name'] = isset($arr['nickname']) ? $arr['nickname'] : '';
     return $userInfo;
 }
Example #9
0
 public function login()
 {
     define('QQ_LOGIN_APPID', $this->config->get('qq_login_appid'));
     define('QQ_LOGIN_APPKEY', $this->config->get('qq_login_appkey'));
     define('QQ_CALLBACK_URI', HTTP_SERVER . 'catalog/controller/api/qq_callback.php');
     require_once DIR_SYSTEM . 'library/qq/qqConnectAPI.php';
     $qc = new QC();
     $qc->qq_login();
 }
Example #10
0
 public function qq_callback()
 {
     require_once "./public/Library/qqAuth/qqConnectAPI.php";
     $qc = new QC();
     //echo $qc->qq_callback();
     $openid = $qc->get_openid();
     $arr = $qc->get_user_info();
     $nickname = $arr["nickname"];
     //TODO 注册登录操作
 }
 /**
  * QQ回调地址 
  *
  */
 public function actionQq_callback()
 {
     require_once Yii::getPathOfAlias('ext') . "/OAuth/qq/qqConnectAPI.php";
     $qc = new QC();
     $access_token = $qc->qq_callback();
     $openid = $qc->get_openid();
     $qc = new QC($access_token, $openid);
     $user_info = $qc->get_user_info();
     //查看是否已绑定
     $bind = OAuthQQ::model()->findByPk($openid);
     //数据
     $data = array('type' => 'qq', 'access_token' => $access_token, 'openid' => $openid, 'uid' => $bind ? $bind->uid : 0, 'username' => $user_info['nickname'], 'avatar' => $user_info['figureurl_2']);
     //绑定注册
     $this->bind_register($bind, $data);
 }
Example #12
0
function QQ_callback()
{
    $cb_arr = array();
    $qc = new QC();
    $access_token = $qc->qq_callback();
    //DE89B12F418C136D96F62898CBC4705E
    $openid = $qc->get_openid();
    //B8C02925F80EE3B4462B86E7868DAC1D
    //echo $access_token;
    //echo $openid;
    $qc1 = new QC($access_token, $openid);
    $userinfo_arr = $qc1->get_user_info();
    $nickname = $userinfo_arr["nickname"];
    $cb_arr = array('access_token' => $access_token, 'openid' => $openid, 'nick' => $nickname);
    return $cb_arr;
}
Example #13
0
 public function __construct($appid, $appkey, $scope, $callback, $errorReport)
 {
     parent::__construct();
     $this->recorder->write("appid", $appid);
     $this->recorder->write("appkey", $appkey);
     $this->recorder->write("scope", $scope);
     $this->recorder->write("callback", $callback);
     $this->recorder->write("errorReport", $errorReport);
     $this->keysArr = array("oauth_consumer_key" => (int) $this->recorder->readInc("appid"), "access_token" => null, "openid" => null);
 }
Example #14
0
 public function callback()
 {
     global_run();
     require_once APP_ROOT_PATH . "system/api_login/qqv2/qqConnectAPI.php";
     $qc = new QC();
     $access_token = $qc->qq_callback();
     $openid = $qc->get_openid();
     $use_info_keysArr = array("access_token" => $access_token, "openid" => $openid, "oauth_consumer_key" => $this->api['config']['app_key']);
     $use_info_url = "https://graph.qq.com/user/get_user_info";
     $graph_use_info_url = $qc->urlUtils->combineURL($use_info_url, $use_info_keysArr);
     $response = $qc->urlUtils->get_contents($graph_use_info_url);
     if ($response['ret'] != 0) {
         showErr("授权失败,错误信息:" . $response['msg']);
         die;
     }
     $response = json_decode($response, 1);
     $msg['field'] = 'qqv2_id';
     $msg['id'] = $openid;
     $msg['name'] = $response["nickname"];
     es_session::set("api_user_info", $msg);
     $user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where qqv2_id = '" . $openid . "' and qqv2_id <> '' and is_effect=1 and is_delete=0");
     $is_bind = intval(es_session::get("is_bind"));
     if ($user_data) {
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set qq_token = '" . $access_token . "',login_ip = '" . CLIENT_IP . "',login_time= " . NOW_TIME . " where id =" . $user_data['id']);
         es_session::delete("api_user_info");
         if ($is_bind) {
             if (intval($user_data['id']) != intval($GLOBALS['user_info']['id'])) {
                 showErr("该帐号已经被别的会员绑定过,请直接用帐号登录", 0, url("index", "uc_account"));
             } else {
                 require_once APP_ROOT_PATH . "system/model/user.php";
                 load_user($user_data['id'], true);
                 es_session::set("user_info", $user_data);
                 app_redirect(url("index", "uc_account"));
             }
         } else {
             require_once APP_ROOT_PATH . "system/model/user.php";
             auto_do_login_user($user_data['user_name'], $user_data['user_pwd'], $from_cookie = false);
             app_redirect(url("index", "index"));
         }
     } elseif ($is_bind == 1 && $GLOBALS['user_info']) {
         //当有用户身份且要求绑定时
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set qqv2_id= '" . $msg['id'] . "', qq_token ='" . $access_token . "' where id =" . $GLOBALS['user_info']['id']);
         require_once APP_ROOT_PATH . "system/model/user.php";
         load_user($GLOBALS['user_info']['id'], true);
         app_redirect(url("index", "uc_account"));
     } else {
         $user_info = $this->create_user();
         require_once APP_ROOT_PATH . "system/model/user.php";
         auto_do_login_user($user_info['user_name'], $user_info['user_pwd'], $from_cookie = false);
         app_redirect(url("index", "index"));
     }
 }
Example #15
0
session_start();
function randusname($name)
{
    $nickname = $name . '_' . rand(1000, 9999);
    return $nickname;
}
require_once "../../../include/conn.php";
require_once "../../../include/myfunction.php";
require_once "../API/qqConnectAPI.php";
require_once "../../../config.inc.php";
require_once "../../../uc_client/client.php";
$siteweb = GetSiteconfig();
$qc = new QC();
$qqcallback = $qc->qq_callback();
$qqid = $qc->get_openid();
$qc = new QC($qqcallback, $qqid);
$arr = $qc->get_user_info();
if (!empty($qqcallback)) {
    $sql = "select * from user where qq_ua='{$qqid}'";
    $result = mysql_query($sql);
    $count = mysql_num_rows($result);
    $usxx = mysql_fetch_assoc($result);
    if (!empty($_SESSION['usnamese']) && !empty($usxx['qq_ua'])) {
        echo "<script>location='/u'</script>";
        exit;
    }
    if ($count) {
        if (time() > $usxx['Pingbi']) {
            $_SESSION['usnamese'] = $usxx['name'];
            $_SESSION['usidse'] = $usxx['id'];
            $_SESSION['shua'] = 1;
Example #16
0
    $template = 'user_edit.html';
} elseif ($_view == 'password_edit') {
    $template = 'user_edit_password.html';
} elseif ($_view == 'activate_email') {
    user::activate_email($_GET['key']);
    $_notice = array('title' => '邮箱激活成功', 'content' => '现在可以设置一个抓取计划或者复制别人的抓取计划', 'button' => '点击这里开始', 'url' => '/');
    $template = 'notice.html';
} elseif ($_view == 'weibo_login') {
    include 'saetv2.ex.class.php';
    $sae_oauth = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
    $login_url = $sae_oauth->getAuthorizeURL(WB_CALLBACK_URL);
    header("Location:{$login_url}");
    exit;
} elseif ($_view == 'qq_login') {
    include INCLUDES_PATH . 'qqapi/qqConnectAPI.php';
    $qc = new QC();
    $qc->qq_login();
    exit;
}
if (isset($_POST['email']) || isset($_POST['password'])) {
    if (isset($_POST['email'])) {
        if (!$_POST['email_notify']) {
            $_POST['email_notify'] = 'off';
        }
    }
    if (isset($_POST['app_notify_pin'])) {
        if (!$_POST['app_notify']) {
            $_POST['app_notify'] = 'off';
        }
    }
    $result = user::update($_POST);
Example #17
0
<?php

if ($_POST) {
    /*
     *调用接口代码
     *
     **/
    require_once "../../API/qqConnectAPI.php";
    $qc = new QC();
    $ret = $qc->add_idol($_POST);
    echo "<meta charset='utf-8' />";
    if ($ret['ret'] == 0) {
        echo "收听成功,请查看微博";
    } else {
        echo "收听失败,请开启调试查看原因";
    }
} else {
    //load view
    require_once "add_idol.html";
}
Example #18
0
 /**
  * 获取腾讯微博偶像列表
  * 具体接口:http://wiki.open.qq.com/wiki/website/get_idollist
  * 
  */
 public static function getWeiboIdolList($paramArr)
 {
     $options = array('openId' => '', 'accessToken' => '', 'num' => 30, 'offset' => 0, 'debug' => false);
     if (is_array($paramArr)) {
         $options = array_merge($options, $paramArr);
     }
     extract($options);
     $obj = new QC(self::$_APPID, $accessToken, $openId, $debug);
     $info = $obj->get_idollist(array("reqnum" => $num, "startindex" => $offset));
     if ($info) {
         //字符转码
         array_walk_recursive($info, "api_json_convert_encoding_u2g");
     }
     return $info;
 }
Example #19
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../../API/qqConnectAPI.php";
$qc = new QC();
$arr = $qc->upload_pic($_POST);
print_r($arr);
echo '<meta charset="utf-8" />';
if ($arr['ret'] == 0) {
    echo "上传成功";
} else {
    echo "失败";
}
Example #20
0
File: QC.php Project: spaiva/Loris
            $selval = $DB->pselectOne("SELECT mst.Scan_type \n                 FROM files f \n                    LEFT JOIN mri_scan_type mst ON (f.AcquisitionProtocolID=mst.ID)\n                 WHERE f.File LIKE CONCAT('%', :FName)", array('FName' => $this->Filename));
        }
        $this->_saveFileQC($data['QCStatus'], $selval);
        $this->JSON = ['success' => 'Updated file QC information'];
    }
    /**
     * Save the QC value to the database. Only call this after everything
     * has been validated
     *
     * @param string $qcval  The Pass/Fail status
     * @param string $selval The value to set the selected field to.
     *
     * @return none
     */
    private function _saveFileQC($qcval, $selval)
    {
        $factory = \NDB_Factory::singleton();
        $DB = $factory->Database();
        $FileID = $DB->pselectOne("SELECT f.FileID FROM files f\n                WHERE f.File LIKE CONCAT('%', :FName)", array('FName' => $this->Filename));
        $AlreadySavedQC = $DB->pselectOne("SELECT COUNT(*) FROM files_qcstatus WHERE FileID=:FID", array('FID' => $FileID));
        if ($AlreadySavedQC > 0) {
            $DB->update("files_qcstatus", ['QCStatus' => $qcval, 'Selected' => $selval], ['FileID' => $FileID]);
        } else {
            $DB->insert("files_qcstatus", ['QCStatus' => $qcval, 'Selected' => $selval, 'FileID' => $FileID]);
        }
    }
}
if (isset($_REQUEST['PrintImageQC'])) {
    $obj = new QC($_SERVER['REQUEST_METHOD'], $_REQUEST['CandID'], $_REQUEST['VisitLabel'], $_REQUEST['Filename']);
    print $obj->toJSONString();
}
 public function index()
 {
     //phpinfo();
     //点击QQ登录
     if (isset($_REQUEST['qq'])) {
         require_once "./Public/QQLogin/qqConnectAPI.php";
         $qc = new QC();
         $qc->qq_login();
         die;
     }
     //QQ登录后返回处理
     if (isset($_REQUEST['code'])) {
         require_once "./Public/QQLogin/qqConnectAPI.php";
         $qc = new QC();
         $acs = $qc->qq_callback();
         $oid = $qc->get_openid();
         $qq_open_id = $qc->get_openid();
         echo $acs . "|" . $oid;
         $qc = new QC($acs, $oid);
         $qq_user = $qc->get_user_info();
         //p($qq_user);die;
         $username = $qq_user['nickname'];
         $sex = $qq_user['gender'] == '男' ? 1 : 0;
         $face = $qq_user['figureurl_2'];
         //头像处理
         /*获取网络图片太忙,展示考虑
             	$qq_face=$qq_user['figureurl_2'];
             	$face=date("Y_m")."/".time().".jpg";
             	$path="./Uploads/face/".date("Y_m");
             	$file="./Uploads/face/".$face;
             	//p($file);die;
             	if(!file_exists($path)){  //检测变量中的文件夹是否存在,如果存在,删除
         			mkdir($path,0777); //创建文件夹
         		}
             	
             	$qq_face=file_get_contents($qq_face);
             	file_put_contents($file, $qq_face);*/
         $user = M('user')->where(array('qq_open_id' => $qq_open_id))->find();
         if (!$user) {
             //第一次登录,保存用户信息
             $data = array('qq_open_id' => $qq_open_id, 'username' => $username, 'sex' => $sex, 'face' => $face, 'description' => $this->_post('description'), 'register_time' => time());
             //p($data);die;
             $user_id = M('user')->add($data);
             if ($user_id) {
                 session('user_id', $user_id);
                 session('username', $username);
                 redirect(U('Index/index'));
                 die;
             } else {
                 redirect(U('Index/index'));
                 die;
             }
         } else {
             //以前登录过
             if ($user['lock'] > time()) {
                 $this->error('您已被锁定,请过段时间在试。。。');
                 die;
             }
             session('user_id', $user['user_id']);
             session('username', $user['username']);
             redirect(U('Index/index'));
         }
         die;
     }
     if (isset($_SESSION['user_id'])) {
         redirect(U('Index/index'));
         die;
     }
     if (!$this->isPost()) {
         $this->display();
         die;
     }
     $username = $this->_post('username');
     $password = $this->_post('password', 'md5');
     $where = array('username' => $username);
     $user = M('user')->where($where)->find();
     p($username);
     p($password);
     //p($user);die;
     if ($user['lock'] == 1) {
         $this->error("您已被锁定,请过段时间在试。。。");
     }
     if (!$user || $user['password'] != $password) {
         $this->error("用户名或者密码错误!~_~");
     }
     session('user_id', $user['user_id']);
     session('username', $user['username']);
     redirect(__APP__);
 }
Example #22
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../API/qqConnectAPI.php";
$qc = new QC();
$setting = array("reqnum" => 10, "startindex" => 0);
$ret = $qc->get_fanslist($setting);
// show result
if ($ret['ret'] == 0) {
    echo "<meta charset='utf-8' />";
    require_once "get_fanslist.html";
} else {
    echo "<meta charset='utf-8' />";
    echo "获取失败,请开启调试查看原因";
}
Example #23
0
function QQ_login()
{
    $qc = new QC();
    $qc->qq_login();
}
Example #24
0
<?php
/*
 *调用接口代码
 *
 **/
require_once("../../API/qqConnectAPI.php");
$qc = new QC();
$setting = array(
    "reqnum" => 10,//请求获取的听众个数。取值范围为1-30。
    "startindex" => 0//开始
   );
$ret = $qc->get_idollist($setting);

// show result
if($ret['ret'] == 0){
    echo "<meta charset='utf-8' />";
    require_once("get_idollist.html");
}else{
    echo "<meta charset='utf-8' />";
    echo "获取失败,请开启调试查看原因";
}
Example #25
0
<?php

require_once "../../API/qqConnectAPI.php";
$qc = new QC();
$qc->qq_login();
echo $qc->qq_callback();
echo $qc->get_openid();
Example #26
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../API/qqConnectAPI.php";
$qc = new QC();
$ret = $qc->get_tenpay_addr();
// show result
if ($ret['ret'] == 0) {
    echo "<meta charset='utf-8' />";
    require_once "get_tenpay_addr.html";
} else {
    echo "<meta charset='utf-8' />";
    echo "获取失败,请开启调试查看原因";
}
Example #27
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../API/qqConnectAPI.php";
$qc = new QC();
$_POST['img'] = urlencode($_POST['img']);
$ret = $qc->add_t($_POST);
?>
<meta charset="utf-8" />

<?php 
if ($ret['ret'] == 0) {
    echo "成功";
} else {
    echo "失败";
}
Example #28
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../API/qqConnectAPI.php";
$qc = new QC();
$arr = $qc->add_album($_POST);
?>
<meta charset="utf-8" />
<?php 
if ($arr['ret'] == 0) {
    echo "创建成功,请到空间相册查看您的相册";
} else {
    echo "创建失败";
}
Example #29
0
<?php

/*
 *调用接口代码
 *
 **/
require_once "../../API/qqConnectAPI.php";
$qc = new QC();
$_POST['title'] = urlencode($_POST['title']);
$_POST['title'] = urlencode($_POST['content']);
$ret = $qc->add_one_blog($_POST);
?>
<meta charset="utf-8" />

<?php 
if ($ret['ret'] == 0) {
    echo "成功";
} else {
    echo "失败";
}
 public function qq_sucsess()
 {
     session_start();
     define('M_ROOT', dirname(dirname(__FILE__)));
     $ss = M_ROOT;
     $str = str_replace("\\", "/", $ss);
     include_once $str . "/API/qq/qqConnectAPI.php";
     $qc = new \QC();
     $atid = $qc->qq_callback();
     $opid = $qc->get_openid();
     $opid = (string) $opid;
     $state = I('state');
     $_SESSION['state'] = $state;
     $qc = new \QC($atid, $opid);
     // 重新带参地new一次否则会丢失信息
     $user_model = D('yuser');
     $find = $user_model->field('uid,username,nickname,figureurl,userpic')->where(' openid=' . '"' . $opid . '"')->find();
     if (empty($find)) {
         $info = $qc->__call('get_user_info');
     }
     if (!empty($info)) {
         $data = array('username' => $info['nickname'], 'nickname' => $info['nickname'], 'sex' => $info['gender'], 'province' => $info['province'], 'city' => $info['city'], 'year' => $info['year'], 'figureurl' => $info['figureurl_qq_2'], 'openid' => $opid, 'tokenid' => $atid, 'addtime' => date('Y-m-d H:i:s'), 'loginip' => get_client_ip(), 'status' => 1);
         if ($id = $user_model->add($data)) {
             $user = $user_model->field('uid,username,figureurl,userpic')->where('uid=' . $id)->find();
             $picName = $find['userpic'];
             $picInfo = pathinfo($picName);
             $find['userpic'] = $picInfo['filename'] . '70.' . $picInfo['extension'];
             $_SESSION['user'] = $user;
             $this->redirect('/Index', '登录成功,正在跳转到首页', 0);
         }
     } else {
         $picName = $find['userpic'];
         $picInfo = pathinfo($picName);
         $find['userpic'] = $picInfo['filename'] . '70.' . $picInfo['extension'];
         $qiandao = $user_model->getQiandao($find['uid']);
         $find['qiandao'] = $qiandao;
         $data = array('lastlogin' => date('Y-m-d H:i:s', time()), 'uid' => session('user.uid'));
         $user_model->save($data);
         $_SESSION['user'] = $find;
         $this->redirect('/Index', '登录成功,正在跳转到首页', 0);
     }
 }