本文整理汇总了PHP中SaeTOAuthV2::getAuthorizeURL方法的典型用法代码示例。如果您正苦于以下问题:PHP SaeTOAuthV2::getAuthorizeURL方法的具体用法?PHP SaeTOAuthV2::getAuthorizeURL怎么用?PHP SaeTOAuthV2::getAuthorizeURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SaeTOAuthV2
的用法示例。
在下文中一共展示了SaeTOAuthV2::getAuthorizeURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reflashToken
private function reflashToken()
{
if (empty($this->m_cfg['username']) || empty($this->m_cfg['password'])) {
return;
}
$this->m_reflash_cookie = tmpDir('reflashsina.cookie');
if (!file_exists($this->m_reflash_cookie)) {
touch($this->m_reflash_cookie);
}
$loginResult = $this->curlLoginSina($this->m_cfg['username'], $this->m_cfg['password']);
if (!$loginResult) {
return $loginResult;
}
$callbackUrl = callbackUrl('sina');
$o = new SaeTOAuthV2($this->m_cfg['key'], $this->m_cfg['secret']);
$authorizeURL = $o->getAuthorizeURL($callbackUrl);
$ch = curl_init($authorizeURL);
$option = array();
$option[CURLOPT_FOLLOWLOCATION] = 1;
$option[CURLOPT_RETURNTRANSFER] = 1;
$option[CURLOPT_COOKIEJAR] = $this->m_reflash_cookie;
$option[CURLOPT_COOKIEFILE] = $this->m_reflash_cookie;
$option[CURLOPT_HTTPHEADER] = array('Accept-Language: zh-cn', 'Connection: Keep-Alive', 'Cache-Control: no-cache');
$option[CURLOPT_USERAGENT] = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)";
curl_setopt_array($ch, $option);
curl_exec($ch);
curl_close($ch);
unlink($this->m_reflash_cookie);
}
示例2: index
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index()
{
$o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$code_url = $o->getAuthorizeURL(WB_CALLBACK_URL);
$data['code_url'] = $code_url;
$this->load->view('celebritytop/navigate_view', $data);
}
示例3: index
public function index()
{
if (!$this->customer->isLogged()) {
$appkey = $this->config->get('weibo_login_appkey');
$appsecret = $this->config->get('weibo_login_appsecret');
$callback_url = $this->url->link('extension/module/weibo_login/callback', '', true);
$this->load->language('extension/module/weibo_login');
$data['text_weibo_login'] = $this->language->get('text_weibo_login');
include_once DIR_SYSTEM . 'library/weibo/saetv2.ex.class.php';
$o = new SaeTOAuthV2($appkey, $appsecret);
$data['code_url'] = $o->getAuthorizeURL($callback_url);
if ($this->customer->isLogged()) {
$data['logged'] = 1;
} else {
$data['logged'] = 0;
}
if (isset($this->session->data['weibo_login_access_token']) && isset($this->session->data['weibo_login_uid'])) {
$data['weibo_login_authorized'] = 1;
} else {
$data['weibo_login_authorized'] = 0;
unset($this->session->data['weibo_login_access_token']);
unset($this->session->data['weibo_login_uid']);
}
$this->load->helper('mobile');
if (is_weixin()) {
$data['is_weixin'] = 1;
} else {
$data['is_weixin'] = 0;
}
return $this->load->view('extension/module/weibo_login', $data);
}
}
示例4: getLoginUrl
function getLoginUrl()
{
require_once dirname(__FILE__) . "/API/saetv2.ex.class.php";
$o = new SaeTOAuthV2(ISession::get('apiKey'), ISession::get('apiSecret'));
$code_url = $o->getAuthorizeURL(parent::getReturnUrl());
return $code_url;
}
示例5: logs
function logs()
{
import("Org.Util.saetv2");
$o = new \SaeTOAuthV2(WB_AKEY, WB_SKEY);
$code_url = $o->getAuthorizeURL(WB_CALLBACK_URL);
return $code_url;
}
示例6: index
public function index()
{
if (isset($this->request->get['message_id']) && $this->request->get['message_id']) {
if (isset($this->request->get['message_id'])) {
$message_id = $this->request->get['message_id'];
} else {
$message_id = '';
}
//判断用户是否登陆
if ($this->customer->isLogged()) {
$this->data['logged'] = 1;
} else {
$this->data['logged'] = 0;
$this->data['error_login'] = "";
$this->data['action'] = $this->url->link('account/login', '', 'SSL');
$this->data['register'] = $this->url->link('account/register', '', 'SSL');
$this->data['forgotten'] = $this->url->link('account/forgotten', '', 'SSL');
$this->data['email'] = '';
$this->data['password'] = '';
include_once DIR_SYSTEM . 'weibo/config.php';
include_once DIR_SYSTEM . 'weibo/saetv2.ex.class.php';
$o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$this->data['code_url'] = $o->getAuthorizeURL(WB_CALLBACK_URL);
}
$this->load->model('social/social');
$message_info = $this->model_social_social->getMessageByid($message_id);
if (isset($this->request->get['page'])) {
$page = $this->request->get['page'];
$this->data['page'] = $page;
} else {
$page = 1;
$this->data['page'] = $page;
}
$limit = 20;
$this->data['limit'] = $limit;
$data = array('message_id' => $message_id, 'start' => ($page - 1) * $limit, 'limit' => $limit);
$comment_info = $this->model_social_social->getComment($data);
$comment_total = $this->model_social_social->getTotalComment($message_id);
//回复的用户id
$this->data['customer_id'] = $this->customer->getId();
//回复的脸
$this->data['face'] = $this->customer->getface();
if (!$this->data['face']) {
$this->data['face'] = "uploads/big/0b4a96400b2372d25da769647bfe4059.jpg";
}
$this->data['message'] = $message_info;
$this->data['comment_info_all'] = $comment_info;
$this->data['comment_total'] = $comment_total;
$pagination = new Pagination();
$pagination->total = $comment_total;
$pagination->page = $page;
$pagination->limit = $limit;
$pagination->text = $this->language->get('text_pagination');
$pagination->url = $this->url->link('social/comment', 'message_id=' . $message_id . '&page={page}', 'SSL');
$this->data['pagination'] = $pagination->render();
$this->template = $this->config->get('config_template') . '/template/social/comment_list.tpl';
$this->children = array('common/footer', 'common/social_right', 'common/header_sns');
$this->response->setOutput($this->render());
}
}
示例7: actionIndex
public function actionIndex()
{
$o = new \SaeTOAuthV2($this->app_key, $this->app_secret);
$code_url = $o->getAuthorizeURL($this->url);
header("location:{$code_url}");
exit;
}
示例8: weibologin
/**
*微博登陆
*@author winter
*@version 2015年11月20日17:27:32
*/
public function weibologin()
{
include_once './libweibo/config.php';
include_once './libweibo/saetv2.ex.class.php';
$o = new \SaeTOAuthV2(WB_AKEY, WB_SKEY);
$code_url = $o->getAuthorizeURL(WB_CALLBACK_URL);
header("Location:" . $code_url);
}
示例9: sinaLogin
/**
* sinaLogin
*/
public function sinaLogin()
{
$state = md5(rand(5, 10));
Yii::app()->session->add('sina_state', $state);
$weiboService = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$this->sina_code_url = $weiboService->getAuthorizeURL(WB_CALLBACK_URL, 'code', $state);
Yii::app()->session->add('back_url', $this->back_url . '?state=' . $state);
}
示例10: actionSinawb
/**
* 新浪微博授权登录
* sinawb login
*/
public function actionSinawb()
{
require_once Yii::getPathOfAlias('ext') . "/OAuth/sinawb/config.php";
require_once Yii::getPathOfAlias('ext') . "/OAuth/sinawb/saetv2.ex.class.php";
$sinawb = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$code_url = $sinawb->getAuthorizeURL(WB_CALLBACK_URL);
$this->redirect($code_url);
}
示例11: run
public function run()
{
require_once Yii::getPathOfAlias('ext') . "/OAuth/sinawb/saetv2.ex.class.php";
$config = OAuth::getConf('sinawb');
$sinawb = new SaeTOAuthV2($config['wb_akey'], $config['wb_skey']);
$code_url = $sinawb->getAuthorizeURL($config['callback']);
$this->controller->redirect($code_url);
}
示例12: SinaAuth
/**
* 是否已经获取到了token,未获取则显示获取token的图标,否则显示当前登录账号
*
* @access public
* @param
* @return string
*/
public static function SinaAuth()
{
self::getPubFile();
$sina_auth = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$authurl = $sina_auth->getAuthorizeURL(WB_CALLBACK_URL, 'code');
$img_path = Helper::options()->pluginUrl . '/WeiboSync/weibo.png';
echo $sina_profile = '<ul class="typecho-option"><li><a href="' . $authurl . '"><img src="' . $img_path . '"></a> <b>点击左边图标获取微博Access_token信息</b></li></ul>';
}
示例13: weibo
public function weibo()
{
Vendor('Weibo.saetv2#ex#class');
$o = new \SaeTOAuthV2(C('weibo.wb_akey'), C('weibo.wb_skey'));
$code_url = $o->getAuthorizeURL(C('weibo.wb_callback_url'));
header('Location: ' . $code_url);
exit;
}
示例14: index
public function index()
{
import('Vendor.Weibo.saetv2');
$weibo = new \SaeTOAuthV2(WB_APPKEY, WB_SKEY);
$code_url = $weibo->getAuthorizeURL(WB_CALLBACK_URL);
$this->assign('code_url', $code_url);
$this->display();
}
示例15:
function sina_oauth()
{
require_once APPPATH . 'libraries/sina/saetv2.ex.class.php';
$o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
$back_url = base_url() . 'index.php?c=oauth&m=sina_oauth_back';
$data['code_url'] = $o->getAuthorizeURL($back_url);
$this->load->view('/oauth/sina_oauth', $data);
}