public function qq() { vendor('QQApi.qqConnectAPI'); //require_once("../../API/qqConnectAPI.php"); $qc = new \QC(); $qc->qq_login(); }
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(); }
public function qqlogin() { define('M_ROOT', dirname(dirname(__FILE__))); // echo M_ROOT; $ss = M_ROOT; $str = str_replace("\\", "/", $ss); include_once $str . "/API/qq/qqConnectAPI.php"; $qc = new \QC(); $qc->qq_login(); $state = I('state'); $_SESSION['state'] = $state; }
public function indexAction() { $app_id = isset($_REQUEST['app_id']) ? trim($_REQUEST['app_id']) : '69948denMVMoBujYGLSFGUHbkvP7E3'; $mediaqqmodel = new Media_QQModel($this->_basemodel, $this->_qqparam); $mediaqq = $mediaqqmodel->getApp($app_id); if ($mediaqq) { if ($mediaqq['dic_media_status'] == 1) { $client_id = $mediaqq['APPID'] && $mediaqq['APPKEY'] ? $mediaqq['APPID'] : $mediaqq['def_APPID']; $redirect_uri = $this->_qqparam['redirect_uri'] . '?app_id=' . $mediaqq['app_id']; $state = md5($mediaqq['app_key']); $redirect_uri = urlencode($redirect_uri); $qcinit = new QQAPI_YafQQConnetAPI(); $qc = new QC(); $qc->qq_login($client_id, $redirect_uri, $mediaqq['app_id'], $state); } else { echo '此第三方已经停用'; } } else { echo 'error'; } exit; }
/** *QQ登陆 */ public function qqlogin() { require 'QQ/API/qqConnectAPI.php'; $qc = new \QC(); $qc->qq_login(); }
function QQ_login() { $qc = new QC(); $qc->qq_login(); }
/** * qq登陆 */ public function qq() { //授权之后的操作 $do = $this->input->get('do'); if ($do) { $this->output->cookie(['auth_action' => $do]); } require_once APP_DIR . "vendors/auth/qq/API/qqConnectAPI.php"; $qc = new \QC(); $qc->qq_login(); }
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__); }
public static function oauthRoute($type) { global $kekezu, $weibo_list; require S_ROOT . "include/oauth/config.php"; if ($type === 'sina') { require S_ROOT . "include/oauth/sina/saetv2.ex.class.php"; $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY); $code_url = $o->getAuthorizeURL(WB_CALLBACK_URL); } if ($type === 'qq') { require S_ROOT . "include/oauth/qq/qqConnectAPI.php"; $qqConnectAPI = new QC(); $qqConnectAPI->qq_login(); die; } if ($type === 'ten') { require S_ROOT . "include/oauth/ten/Tencent.php"; OAuth::init(TEN_AKEY, TEN_SKEY); Tencent::$debug = false; $code_url = OAuth::getAuthorizeURL(TEN_CALLBACK_URL); } if ($type === 'renren') { require S_ROOT . "include/oauth/renren/rennclient/RennClient.php"; $rennClient = new RennClient(APP_KEY, APP_SECRET); $state = uniqid('renren_', true); $_SESSION['renren_state'] = $state; $code_url = $rennClient->getAuthorizeURL(CALLBACK_URL, 'code', $state); } if ($type === 'douban') { require S_ROOT . 'include/oauth/douban/douban.php'; $douBan = new doubanPHP(DB_APIKEY, DB_SECRET); $code_url = $douBan->login_url(DB_CALLBACK_URL, DB_SCOPE); } header("location:" . $code_url); }
public function qq_login() { require_once "./public/Library/qqAuth/qqConnectAPI.php"; $qc = new QC(); $qc->qq_login(); }
public function qq() { Vendor('Oauth.QC#class'); $qc = new \QC(); $qc->qq_login(); }
/** * 执行qq登录 */ public static function qqLogin() { $qq = new QC(); $qq->qq_login(); }
/** * QQ授权登录 * when an action is not explicitly requested by users. */ public function actionQq() { require_once Yii::getPathOfAlias('ext') . "/OAuth/qq/qqConnectAPI.php"; $qc = new QC(); $qc->qq_login(); }
/** * 登录 */ public function login() { require_once COMMON_LIB_PATH . "QqConnect/API/qqConnectAPI.php"; $qc = new QC(); $qc->qq_login(); }
public function byqq() { require_once APPPATH . "libraries/QQAPI/qqConnectAPI.php"; $qc = new QC(); $qc->qq_login(); }
public function index() { //点击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(); $qc = new QC($acs, $oid); $qq_user = $qc->get_user_info(); //p($user);die; $qq_open_id = $qc->get_openid(); $username = $qq_user['nickname']; $sex = $qq_user['gender'] == '男' ? 1 : 0; $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, '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', $this->_post('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__); }
/** * 腾讯微博分享 */ function tencent() { $this->type = 'QQ'; $this->getConfig(); vendor('qq.qq'); $QC = new \QC(); $QC->recorder->write("appid", $this->AppKey); $QC->recorder->write("appkey", $this->AppSecret); $QC->recorder->write("callback", 'http://' . $_SERVER['HTTP_HOST'] . "/Api/Share/tencent"); $QC->reInit(); //由于qq互联奇葩的回调地址规则,必须要完整的回调地址并且不能带有参数 //所以将参数以session的形式存储 //作者按:腾讯你个sb if ($_REQUEST['picurl']) { session("share_picurl", $_REQUEST['picurl']); } if ($_REQUEST['sharecomment']) { session("share_sharecomment", $_REQUEST['sharecomment']); } if ($_GET['table']) { session("share_table", $this->table); } if ($_GET['id']) { session("share_id", $this->id); } //============================================== if (empty($QC->recorder->read("access_token")) || empty($QC->recorder->read("openid"))) { if ($_GET['code']) { //已获得code $QC->qq_callback(); $QC->get_openid(); $QC->reInit(); $_FILES['pic'] = "@." . session("share_picurl"); $_POST['content'] = session("share_sharecomment") . "http://" . $_SERVER['HTTP_HOST'] . "/Portal/" . session("share_table") . "/info/id/" . session("share_id"); $ret = $QC->add_pic_t($_POST); if ($ret['ret'] == 0) { $this->table = session("share_table"); $this->id = session("share_id"); $this->share(); } else { alert("发表失败"); } } else { //获取授权code $QC->qq_login(); } } else { $_FILES['pic'] = "@." . session("share_picurl"); $_POST['content'] = session("share_sharecomment"); $ret = $QC->add_pic_t($_POST); if ($ret['ret'] == 0) { $this->share(); } else { alert("发表失败"); } } }
<?php require_once "../../API/qqConnectAPI.php"; $qc = new QC(); $qc->qq_login(); echo $qc->qq_callback(); echo $qc->get_openid();
public function getLoginUrl() { require_once dirname(__FILE__) . "/API/qqConnectAPI.php"; $qc = new QC(); return $qc->qq_login($this->apiId, urlencode(parent::getReturnUrl())); }