• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP SaeTOAuthV2类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中SaeTOAuthV2的典型用法代码示例。如果您正苦于以下问题:PHP SaeTOAuthV2类的具体用法?PHP SaeTOAuthV2怎么用?PHP SaeTOAuthV2使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了SaeTOAuthV2类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: weibocallback

 public function weibocallback($code)
 {
     $cfg = K::$system->config->get('connect');
     if (defined('IN_MOBILE')) {
         $mobile = K::$system->config->get('mobile');
         $callback = $mobile['url'] . '/' . K::M('helper/link')->mklink('passport:weibocallback');
     } else {
         $site = K::$system->config->get('site');
         $callback = $site['siteurl'] . '/' . K::M('helper/link')->mklink('passport:weibocallback');
     }
     if (empty($cfg['weibo_is_open'])) {
         $this->err->add('很抱歉网站管理员还未开启微博登录功能', 201);
         return false;
     }
     $keys = array();
     $keys['code'] = $code;
     $keys['redirect_uri'] = $callback;
     $o = new SaeTOAuthV2($cfg['weibo_app_id'], $cfg['weibo_app_key']);
     try {
         $token = $o->getAccessToken('code', $keys);
     } catch (OAuthException $e) {
         $this->err->add($e->getMessage(), 201);
         return false;
     }
     $c = new SaeTClientV2($cfg['weibo_app_id'], $cfg['weibo_app_key'], $token['access_token']);
     $ms = $c->home_timeline();
     // done
     $uid_get = $c->get_uid();
     $uid = $uid_get['uid'];
     $user_message = $c->show_user_by_id($uid);
     //根据ID获取用户等基本信息
     return $this->login($uid, $user_message);
 }
开发者ID:a195474368,项目名称:ejiawang,代码行数:33,代码来源:weibo.mdl.php


示例4: actionReturn

 function actionReturn()
 {
     $o = new \SaeTOAuthV2($this->app_key, $this->app_secret);
     if ($_REQUEST['code']) {
         $keys = array();
         $keys['code'] = $_REQUEST['code'];
         $keys['redirect_uri'] = $this->url;
         try {
             $token = $o->getAccessToken('code', $keys);
             $access_token = $token['access_token'];
             $c = new \SaeTClientV2($this->app_key, $this->app_secret, $access_token);
             $uid_get = $c->get_uid();
             $uid = $uid_get['uid'];
             $me = $c->show_user_by_id($uid);
             $me['name'] = $me['screen_name'];
             $me['options'] = array('url' => $me['profile_url']);
             $r = $this->member_get_third_set_user($me, $this->oauth_id, $access_token);
             flash('success', __('login success'));
             $this->redirect(return_url());
         } catch (OAuthException $e) {
             flash('error', __('login error'));
             $this->redirect(return_url());
         }
     }
     exit;
 }
开发者ID:rocketyang,项目名称:mincms,代码行数:26,代码来源:SinaController.php


示例5: getWeiboUserInfo

    public static function getWeiboUserInfo()
    {
        if (!self::$_config) {
            self::$_config = (require_once WEIBO_PATH . 'config/config.php');
        }
        $o = new SaeTOAuthV2(self::$_config['WB_AKEY'], self::$_config['WB_SKEY']);
        if (isset($_REQUEST['code'])) {
            $keys = array();
            $keys['code'] = $_REQUEST['code'];
            $keys['redirect_uri'] = self::$_config['WB_CALLBACK_URL'];
            try {
                $token = $o->getAccessToken('code', $keys);
            } catch (OAuthException $e) {
            }
        }
        if ($token) {
            $_SESSION['token'] = $token;
            setcookie('weibojs_' . $o->client_id, http_build_query($token), '/');
            //把新浪微博的用户信息存起来
            self::createWeiboUser();
            //跳回登录前的页面
            self::callbackLast();
            ?>
			<?php 
        } else {
            ?>
			授权失败。
			<?php 
        }
    }
开发者ID:lughong,项目名称:test,代码行数:30,代码来源:WeiBoLogin.class.php


示例6: 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, null, null);
     if (isset($_REQUEST['code'])) {
         $keys = array();
         $keys['code'] = $_REQUEST['code'];
         $keys['redirect_uri'] = WB_CALLBACK_URL;
         try {
             $token = $o->getAccessToken('code', $keys);
             $data['token'] = $token;
         } catch (OAuthException $e) {
             echo $e;
         }
     }
     if (isset($token)) {
         $this->session->set_userdata($token);
         //设定Session,将$token写入session
         $this->input->set_cookie('weibojs_' . $o->client_id, http_build_query($token));
         //设定cookie
         $data['flag'] = 'Y';
     } else {
         $data['flag'] = 'N';
     }
     $data['o'] = $o;
     $this->load->view('celebritytop/callback_view', $data);
 }
开发者ID:yunsite,项目名称:sina-weobo,代码行数:41,代码来源:callback.php


示例7: bindSina

 /**
  * sina绑定
  */
 function bindSina()
 {
     $code = $this->trimmed('code');
     if (empty($code)) {
         $this->clientError('cannot find sina code, oauth failed', $code);
         exit;
     }
     $keys = array();
     $keys['code'] = $code;
     $keys['redirect_uri'] = WB_CALLBACK_URL;
     try {
         $sinaOauth = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
         $token = $sinaOauth->getAccessToken('code', $keys);
     } catch (OAuthException $e) {
         $this->clientError("oauth failed {$e}", 400);
         exit;
     }
     $url = 'https://api.weibo.com/2/users/show.json?' . http_build_query(array('access_token' => $token['access_token'], 'uid' => $token['uid']));
     $user = json_decode(file_get_contents($url));
     if (array_key_exists("error", $user)) {
         $this->clientError($user, 400);
     }
     $userOption = array('via' => 'weibo', 'uid' => $user->id, 'screen_name' => $user->screen_name, 'name' => $user->name, 'location' => $user->location, 'description' => $user->description, 'image' => $user->profile_image_url, 'access_token' => $token->access_token, 'expire_at' => $token->expires, 'refresh_token' => $token->refresh_token);
     $this->bind_common($user->id, User::PLATFORM_TYPE_SINA, $userOption);
 }
开发者ID:jianoll,项目名称:SpeakEnglish_Server,代码行数:28,代码来源:apiaccountbindplatform.php


示例8: callback

 function callback()
 {
     $o = new SaeTOAuthV2(c('weibo_akey'), c('weibo_skey'));
     if (isset($_REQUEST['code'])) {
         $keys = array();
         $keys['code'] = $_REQUEST['code'];
         $keys['redirect_uri'] = 'http://' . c('site_domain') . '/?c=weibo&a=callback';
         try {
             $token = $o->getAccessToken('code', $keys);
         } catch (OAuthException $e) {
         }
         $_SESSION['weibo_token'] = $token;
         // get user info
         $c = new SaeTClientV2(c('weibo_akey'), c('weibo_skey'), atoken());
         $info = $c->show_user_by_id(wbuid());
         if (strlen($info['name']) < 1) {
             return info_page('登入失败,请去吃点零食后重试');
         }
         $_SESSION['weibo_uid'] = $info['name'];
         $_SESSION['uname'] = $info['name'];
         $_SESSION['avatar'] = $info['profile_image_url'];
         //print_r( $_SESSION );
         header("Location: /?a=index");
     }
 }
开发者ID:oxmcvusd,项目名称:nowboard,代码行数:25,代码来源:weibo.class.php


示例9: actionCallback

 /**
  * 授权页
  */
 public function actionCallback()
 {
     // weibo POST
     //从POST过来的signed_request中提取oauth2信息
     if (!empty($_REQUEST["signed_request"])) {
         $o = new SaeTOAuthV2(Yii::app()->params['WB_AKEY'], Yii::app()->params['WB_SKEY']);
         $data = $o->parseSignedRequest($_REQUEST["signed_request"]);
         if ($data == '-2') {
             die('签名错误!');
         } else {
             $_SESSION['oauth2'] = $data;
         }
     }
     //print_r($_SESSION['oauth2']);
     if (empty($_SESSION['oauth2']["user_id"])) {
         //若没有获取到access token,则发起授权请求
         $this->render('auth');
     } else {
         //若已获取到access token,则加载应用信息
         //print_r($_SESSION['oauth2']);
         $c = new SaeTClientV2(Yii::app()->params['WB_AKEY'], Yii::app()->params['WB_SKEY'], $_SESSION['oauth2']['oauth_token'], '');
         Yii::app()->session['api'] = $c;
         $this->redirect('/');
         //setcookie( 'weibojs_'.$o->client_id, http_build_query($_SESSION['oauth2']) );
     }
 }
开发者ID:aa10240tw,项目名称:weather,代码行数:29,代码来源:FrameController.php


示例10: sinalogin

 public function sinalogin()
 {
     $loginconfig = FS("Webconfig/loginconfig");
     define("WB_AKEY", $loginconfig['sina']['akey']);
     define("WB_SKEY", $loginconfig['sina']['skey']);
     define("WB_CALLBACK_URL", C('WEB_URL') . __APP__ . '/member/oauth/sinalogin');
     require C("APP_ROOT") . "Lib/Oauth/sina/saetv2.ex.class.php";
     $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
     if (isset($_REQUEST['code'])) {
         $keys = array();
         $keys['code'] = $_REQUEST['code'];
         $keys['redirect_uri'] = WB_CALLBACK_URL;
         try {
             $token = $o->getAccessToken('code', $keys);
         } catch (OAuthException $e) {
         }
     }
     if ($token) {
         $_SESSION['token'] = $token;
     } else {
         exit("出错,请重试");
     }
     $map['openid'] = text($token['uid']);
     //唯一ID
     $map['site'] = 'sina';
     $this->appCk($map, "@sina" . $map['openid'], 'sina');
     //nickname
 }
开发者ID:kinglong366,项目名称:p2p,代码行数:28,代码来源:OauthController.class.php


示例11: 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


示例12: WB_callback

function WB_callback()
{
    $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
    if (isset($_REQUEST['code'])) {
        $keys = array();
        $keys['code'] = $_REQUEST['code'];
        //                $login_type = getvaluebykey('login_type');
        //                $userid = getvaluebykey('userid');
        //                print_r($userid);exit;
        //                $headpic = getvaluebykey('headpic');
        //                $emailnum  = getvaluebykey('emailnum');
        $keys['redirect_uri'] = WB_CALLBACK_URL;
        //.'?login_type='.$login_type.'_'.$userid.'_'.$headpic.'_'.$emailnum;
        try {
            $token = $o->getAccessToken('code', $keys);
            //print_r($token);
        } catch (OAuthException $e) {
        }
    }
    if ($token) {
        $_SESSION['token'] = $token;
        $c1 = new SaeTClientV2(WB_AKEY, WB_SKEY, $token['access_token']);
        $userinfo = $c1->show_user_by_id($token[uid]);
        setcookie('weibojs_' . $o->client_id, http_build_query($token));
        $cb_arr = array('access_token' => $token['access_token'], 'openid' => $token[uid], 'nick' => $userinfo['name']);
        return $cb_arr;
    }
}
开发者ID:yonglinchen,项目名称:shopping,代码行数:28,代码来源:callback.php


示例13: get_info

 function get_info()
 {
     if ($this->dx_auth->is_logged_in()) {
         echo "你已经登陆了";
     } else {
         $this->load->model('m_open');
         session_start();
         require_once APPPATH . 'libraries/weibo/config.php';
         require_once APPPATH . 'libraries/weibo/saetv2.ex.class.php';
         $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
         $o->set_debug(DEBUG_MODE);
         if (isset($_REQUEST['code'])) {
             $keys = array();
             // 验证state
             $state = $_REQUEST['state'];
             if (empty($state) || $state !== $_SESSION['weibo_state']) {
                 echo '非法请求!';
                 exit;
             }
             unset($_SESSION['weibo_state']);
             $keys['code'] = $_REQUEST['code'];
             $keys['redirect_uri'] = WB_CALLBACK_URL;
             try {
                 $token = $o->getAccessToken('code', $keys);
             } catch (OAuthException $e) {
             }
         }
         if ($token) {
             $_SESSION['token'] = $token;
             setcookie('weibojs_' . $o->client_id, http_build_query($token));
             //echo "success";
             $c = new SaeTClientV2(WB_AKEY, WB_SKEY, $_SESSION['token']['access_token']);
             $c->set_debug(DEBUG_MODE);
             $uid_get = $c->get_uid();
             $uid = $uid_get['uid'];
             if (!$uid) {
                 echo "error";
             }
             $user = $c->show_user_by_id($uid);
             //根据ID获取用户等基本信息
             //echo $user['screen_name'];
             if ($this->m_open->is_id($uid)) {
                 $this->m_open->login($uid);
                 //echo "登陆";
                 //echo $uid;
                 //$c->update( "坑爹的api终于调好了");
                 redirect('line');
             } else {
                 $this->m_open->register($user);
                 $this->m_open->create($user);
                 //echo $uid;
                 //echo "注册";
                 redirect('line');
             }
         } else {
             echo "fail";
         }
     }
 }
开发者ID:bullda,项目名称:CI_weibo_login,代码行数:59,代码来源:open.php


示例14: 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


示例15: 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


示例16: 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


示例17: 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


示例18: callback

 /**
  * 授权回调地址
  */
 public function callback()
 {
     if (empty($_GET['code'])) {
         throw new Typecho_Exception(_t('无效请求!'));
     }
     //跳转
     if (!class_exists('SaeTOAuthV2')) {
         require_once './saetv2.ex.class.php';
     }
     $saeto_client = new SaeTOAuthV2($this->config->client_id, $this->config->client_secret);
     //取access_token
     $access_token = $saeto_client->getAccessToken('code', array('code' => trim($_GET['code']), 'redirect_uri' => $this->config->callback_url));
     if (empty($access_token) || !is_array($access_token) || empty($access_token['uid'])) {
         throw new Typecho_Exception(_t('获取access_token失败,请返回重新授权!'));
     }
     $table = $this->db->getPrefix() . self::$tableName;
     $query = $this->db->query("SELECT * FROM {$table} WHERE openid='{$access_token['uid']}' AND plateform='sina'");
     $users_oauth = $this->db->fetchRow($query);
     if (!empty($users_oauth['uid'])) {
         //该新浪帐号已经绑定了用户
         if (Typecho_Widget::widget('Widget_User')->hasLogin()) {
             /** 直接返回 */
             $this->response->redirect(Typecho_Widget::widget('Widget_Options')->index);
         } else {
             //让其直接登陆
             $this->setUserLogin($users_oauth['uid']);
             if (!Typecho_Widget::widget('Widget_User')->pass('contributor', true)) {
                 /** 不允许普通用户直接跳转后台 */
                 $this->response->redirect(Typecho_Widget::widget('Widget_Options')->profileUrl);
             } else {
                 $this->response->redirect(Typecho_Widget::widget('Widget_Options')->adminUrl);
             }
         }
         exit;
     }
     //该新浪帐号未绑定过
     /** 如果已经登录 */
     if (Typecho_Widget::widget('Widget_User')->hasLogin()) {
         /** 直接绑定 */
         $cookieUid = Typecho_Cookie::get('__typecho_uid');
         $this->bindOauthUser($cookieUid, $access_token['uid'], 'sina', $access_token['expires_in']);
         $this->response->redirect(Typecho_Widget::widget('Widget_Options')->index);
     } else {
         //取用户信息
         $saetc_client = new SaeTClientV2($this->config->client_id, $this->config->client_secret, $access_token['access_token']);
         $weibo_user = $saetc_client->show_user_by_id($access_token['uid']);
         //创建用户
         $uid = $this->registerFromWeiboUser($weibo_user);
         if (!$uid) {
             throw new Typecho_Exception(_t('创建帐号失败,请联系管理员!'));
         }
         $this->setUserLogin($uid);
         $this->bindOauthUser($uid, $access_token['uid'], 'sina', $access_token['expires_in']);
         $this->response->redirect(Typecho_Widget::widget('Widget_Options')->profileUrl);
     }
     //构造用户帐号
     exit;
 }
开发者ID:duxiangfei,项目名称:plugins,代码行数:61,代码来源:AuthorizeAction.php


示例19: __construct

 function __construct($allow_debug = false)
 {
     $this->memcache = new Memcache();
     $this->memcache->connect(MC_HOST, 11211) or die("Could not connect");
     if (!$this->memcache->get(MC_KEY)) {
         $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
         $code_url = $o->getAuthorizeURL(WB_CALLBACK_URL);
         if ($allow_debug) {
             echo '<a href="' . $code_url . '">' . $code_url . '</a><br /><br />';
         }
     }
     $this->c = new SaeTClientV2(WB_AKEY, WB_SKEY, $this->memcache->get(MC_KEY));
     $this->c->set_debug($allow_debug);
 }
开发者ID:XinRan5312,项目名称:webot,代码行数:14,代码来源:WeiboPoster.php


示例20: index

 public function index()
 {
     $temp = $this->session->userdata('access_token');
     if (empty($temp)) {
         $o = new SaeTOAuthV2(WB_AKEY, WB_SKEY);
         $code_url = $o->getAuthorizeURL(WB_CALLBACK_URL);
         echo "<meta http-equiv=refresh content='0; url={$code_url}'>";
         //跳转到授权页面
     } else {
         $user_info = $this->celtop_model->get_user_day();
         $data['user_info'] = $user_info;
         $this->load->view('celebritytop/homepage_view', $data);
     }
 }
开发者ID:yunsite,项目名称:sina-weobo,代码行数:14,代码来源:homepage.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Safe类代码示例发布时间:2022-05-23
下一篇:
PHP SaeTClientV2类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap