Esempio n. 1
0
 case 'sina_oauth':
     $sina_oa = new WeiboOAuth(WB_AKEY, WB_SKEY, $_SESSION['sina_keys']['oauth_token'], $_SESSION['sina_keys']['oauth_token_secret']);
     $sina_last_key = $sina_oa->getAccessToken($_REQUEST['oauth_verifier']);
     $_SESSION['sina_last_key'] = $sina_last_key;
     $page = MF_URL . 'action.php?act=insert_oauth&mb=sina';
     go($page);
     break;
 case 'qq_oauth':
     $tecent_oa = new MBOpenTOAuth(MB_AKEY, MB_SKEY, $_SESSION['tecent_keys']['oauth_token'], $_SESSION['tecent_keys']['oauth_token_secret']);
     $tecent_last_key = $tecent_oa->getAccessToken($_REQUEST['oauth_verifier']);
     $_SESSION['tecent_last_key'] = $tecent_last_key;
     $page = MF_URL . 'action.php?act=insert_oauth&mb=qq';
     go($page);
     break;
 case '163_oauth':
     $wangyi_oa = new wy_WeiboOAuth(WY_AKEY, WY_SKEY, $_SESSION['wangyi_keys']['oauth_token'], $_SESSION['wangyi_keys']['oauth_token_secret']);
     $wangyi_last_key = $wangyi_oa->getAccessToken($_REQUEST['oauth_token']);
     $_SESSION['wangyi_last_key'] = $wangyi_last_key;
     $page = MF_URL . 'action.php?act=insert_oauth&mb=163';
     go($page);
     break;
 case 'insert_oauth':
     $user = sql_query('SELECT * FROM ' . DB_PREFIX . 'user WHERE username = "******"');
     $user = mysql_fetch_array($user);
     $microblog = unserialize($user['microblog']);
     switch ($_GET['mb']) {
         case 'sina':
             $sina = new WeiboClient(WB_AKEY, WB_SKEY, $_SESSION['sina_last_key']['oauth_token'], $_SESSION['sina_last_key']['oauth_token_secret']);
             $sina = $sina->verify_credentials();
             $microblog['sina']['id'] = $sina['name'];
             $microblog['sina']['oauth_token'] = $_SESSION['sina_last_key']['oauth_token'];
Esempio n. 2
0
     //sina weibo
     $sina_o = new WeiboOAuth(WB_AKEY, WB_SKEY);
     $sina_keys = $sina_o->getRequestToken();
     $sina_callback = MF_URL . 'action.php?act=sina_oauth';
     $sina_aurl = $sina_o->getAuthorizeURL($sina_keys['oauth_token'], false, $sina_callback);
     $_SESSION['sina_keys'] = $sina_keys;
     //qq weibo
     echo '<span style="display:none;">';
     $tecent_o = new MBOpenTOAuth(MB_AKEY, MB_SKEY);
     $tecent_keys = $tecent_o->getRequestToken(MF_URL . 'action.php?act=qq_oauth');
     $tecent_aurl = $tecent_o->getAuthorizeURL($tecent_keys['oauth_token'], false, '');
     $_SESSION['tecent_keys'] = $tecent_keys;
     echo '</span>';
     //163 weibo
     echo '<span style="display:none;">';
     $wangyi_o = new wy_WeiboOAuth(WY_AKEY, WY_SKEY);
     $wangyi_keys = $wangyi_o->getRequestToken();
     $wangyi_callback = MF_URL . 'action.php?act=163_oauth';
     $wangyi_aurl = $wangyi_o->getAuthorizeURL($wangyi_keys['oauth_token'], true, $wangyi_callback);
     $_SESSION['wangyi_keys'] = $wangyi_keys;
     echo '</span>';
     //
     require_once './template/setting.php';
     break;
 case 'login':
     require_once './template/login.php';
     break;
 case 'view':
     $entry = sql_query('SELECT * FROM ' . DB_PREFIX . 'entry WHERE id ="' . $_GET['id'] . '"');
     $entry = mysql_fetch_object($entry);
     $userid = $entry->userid;