function spacecp_profile_bottom()
 {
     global $_G;
     if (submitcheck('profilesubmit')) {
         $_G['group']['maxsigsize'] = $_G['group']['maxsigsize'] < 200 ? 200 : $_G['group']['maxsigsize'];
         return;
     }
     if ($_G['uid'] && $_G['setting']['connect']['allow']) {
         require_once libfile('function/connect');
         connect_merge_member();
         if ($_G['member']['conuin'] && $_G['member']['conuinsecret']) {
             $arr = array();
             $arr['oauth_consumer_key'] = $_G['setting']['connectappid'];
             $arr['oauth_nonce'] = mt_rand();
             $arr['oauth_timestamp'] = TIMESTAMP;
             $arr['oauth_signature_method'] = 'HMAC_SHA1';
             $arr['oauth_token'] = $_G['member']['conuin'];
             ksort($arr);
             $arr['oauth_signature'] = connect_get_oauth_signature('http://cp.discuz.qq.com/connect/getSignature', $arr, 'GET', $_G['member']['conuinsecret']);
             $result = connect_output_php('http://cp.discuz.qq.com/connect/getSignature?' . http_build_query($arr, '', '&'));
             if ($result['status'] == 0) {
                 $js = 'a.onclick = function () { seditor_insertunit(\'sightml\', \'[wb=' . $result['result']['username'] . ']' . $result['result']['signature_url'] . '[/wb]\'); };';
             } else {
                 $js = 'a.onclick = function () { showDialog(\'' . lang('plugin/qqconnect', 'connect_wbsign_no_account') . '\'); };';
             }
         } else {
             $js = 'a.onclick = function () { showDialog(\'' . lang('plugin/qqconnect', 'connect_wbsign_no_bind') . '\'); };';
         }
         return '<script type="text/javascript">if($(\'sightmlsml\')) {' . 'var a = document.createElement(\'a\');a.href = \'javascript:;\';a.style.background = \'url(\' + STATICURL + \'image/common/weibo.png) no-repeat 0 2px\';' . 'a.onmouseover = function () { showTip(this); };a.setAttribute(\'tip\', \'' . lang('plugin/qqconnect', 'connect_wbsign_tip') . '\');' . $js . '$(\'sightmlsml\').parentNode.appendChild(a);' . '}</script>';
     }
 }
Beispiel #2
0
function connect_get_access_token($request_token, $verify_code)
{
    global $_G;
    $api_url = $_G['connect']['api_url'] . '/oauth/accessToken';
    $extra = array();
    $extra['oauth_token'] = $request_token;
    $extra['oauth_verifier'] = $verify_code;
    $sig_params = connect_get_oauth_signature_params($extra);
    $oauth_token_secret = $_G['cookie']['con_request_token_secret'];
    $sig_params['oauth_signature'] = connect_get_oauth_signature($api_url, $sig_params, 'POST', $oauth_token_secret);
    $params = array('client_ip' => $_G['clientip']);
    $params = array_merge($sig_params, $params);
    dsetcookie('con_request_token');
    dsetcookie('con_request_token_secret');
    $response = connect_output_php($api_url . '?', cloud_http_build_query($params, '', '&'));
    return $response;
}
Beispiel #3
0
            $_G['gp_attach_image'] = implode('|', $attach_images);
            unset($attach_images);
        }
    }
} elseif ($pluginop == 'new') {
    $sh_type = trim(intval($_G['gp_sh_type']));
    $tid = trim(intval($_G['gp_thread_id']));
    $dialog_id = $_G['gp_dialog_id'];
    $sync_post = $_G['gp_sync_post'];
    connect_merge_member();
    $api_url = $_G['connect']['api_url'] . '/connect/share/new';
    $extra = array();
    $extra['oauth_token'] = $_G['member']['conuin'];
    $sig_params = connect_get_oauth_signature_params($extra);
    $oauth_token_secret = $_G['member']['conuinsecret'];
    $sig_params['oauth_signature'] = connect_get_oauth_signature($api_url, $sig_params, 'POST', $oauth_token_secret);
    $params['sh_type'] = $sh_type;
    $params['subject'] = $_G['gp_subject'];
    $params['share_subject'] = $_G['gp_share_subject'];
    $params['thread_id'] = $_G['gp_thread_id'];
    $params['author'] = $_G['gp_author'];
    $params['author_id'] = $_G['gp_author_id'];
    $params['forum_id'] = $_G['gp_forum_id'];
    $params['p_id'] = $_G['gp_post_id'];
    $parmas['u_id'] = $_G['uid'];
    $params['reason'] = $_G['gp_reason'];
    $params['content'] = $_G['gp_html_content'];
    $params['client_ip'] = $_G['clientip'];
    $params['attach_images'] = $_G['gp_attach_image'];
    $params = array_merge($sig_params, $params);
    $response = connect_output_php($api_url . '?', cloud_http_build_query($params, '', '&'));
Beispiel #4
0
        showmessage('qqconnect:connect_config_unbind_success', 'member.php?mod=logging&action=login');
    }
} else {
    if ($_G[inajax] && $op == 'synconfig') {
        DB::query("UPDATE " . DB::table('common_member_connect') . " SET conispublishfeed='0', conispublisht='0' WHERE uid='{$_G['uid']}'");
        dsetcookie('connect_synpost_tip');
    } elseif ($op == 'weibosign') {
        require_once libfile('function/connect');
        connect_merge_member();
        if ($_G['member']['conuin'] && $_G['member']['conuinsecret']) {
            $arr = array();
            $arr['oauth_consumer_key'] = $_G['setting']['connectappid'];
            $arr['oauth_nonce'] = mt_rand();
            $arr['oauth_timestamp'] = TIMESTAMP;
            $arr['oauth_signature_method'] = 'HMAC_SHA1';
            $arr['oauth_token'] = $_G['member']['conuin'];
            ksort($arr);
            $arr['oauth_signature'] = connect_get_oauth_signature('http://api.discuz.qq.com/connect/getSignature', $arr, 'GET', $_G['member']['conuinsecret']);
            $result = connect_output_php('http://api.discuz.qq.com/connect/getSignature?' . cloud_http_build_query($arr, '', '&'));
            if ($result['status'] == 0) {
                connect_ajax_ouput_message('[wb=' . $result['result']['username'] . ']' . $result['result']['signature_url'] . '[/wb]', 0);
            } else {
                connect_ajax_ouput_message('connect_wbsign_no_account', $result['status']);
            }
        } else {
            connect_ajax_ouput_message('connect_wbsign_no_bind', -1);
        }
    } else {
        dheader('location: home.php?mod=spacecp&ac=plugin&id=qqconnect:spacecp');
    }
}