当前位置: 首页>>代码示例>>PHP>>正文


PHP SaeTOAuthV2::getAuthorizeURL方法代码示例

本文整理汇总了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);
 }
开发者ID:snowleopardw,项目名称:Tw2other,代码行数:29,代码来源:Sync.php

示例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);
 }
开发者ID:yunsite,项目名称:sina-weobo,代码行数:22,代码来源:navigate.php

示例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);
     }
 }
开发者ID:brunoxu,项目名称:mycncart,代码行数:32,代码来源:weibo_login.php

示例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;
 }
开发者ID:yongge666,项目名称:sunupedu,代码行数:7,代码来源:sina.php

示例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;
 }
开发者ID:xiaoyueer98,项目名称:pc.rrl.com,代码行数:7,代码来源:TestController.class.php

示例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());
     }
 }
开发者ID:TheTypoMaster,项目名称:ACGStorm,代码行数:60,代码来源:comment.php

示例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;
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:7,代码来源:SinaController.php

示例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);
 }
开发者ID:songxiaoxiao,项目名称:zyw,代码行数:13,代码来源:LoginController.class.php

示例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);
 }
开发者ID:ryanliketea,项目名称:oauth-login-for-yii,代码行数:11,代码来源:OauthLogin.php

示例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);
 }
开发者ID:redtreelchao,项目名称:wander-moon,代码行数:12,代码来源:OAuthController.php

示例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);
 }
开发者ID:jerrylsxu,项目名称:yiifcms,代码行数:8,代码来源:SinawbAction.php

示例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>&nbsp;&nbsp;<b>点击左边图标获取微博Access_token信息</b></li></ul>';
 }
开发者ID:vfhky,项目名称:WeiboSync,代码行数:15,代码来源:Plugin.php

示例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;
 }
开发者ID:kjzwj,项目名称:jcms,代码行数:8,代码来源:oauthAction.class.php

示例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();
 }
开发者ID:medolyWu,项目名称:lvzhisha,代码行数:8,代码来源:LoginController.class.php

示例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);
 }
开发者ID:snamper,项目名称:CI_xiaoshuhaochi,代码行数:8,代码来源:oauth.php


注:本文中的SaeTOAuthV2::getAuthorizeURL方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。