Esempio n. 1
0
function social_connect_verify_signature_pr($data, $signature, $redirect_to)
{
    $generated_signature = social_connect_generate_signature_pr($data);
    if ($generated_signature != $signature) {
        wp_safe_redirect($redirect_to);
        exit;
    }
}
Esempio n. 2
0
require_once dirname(__FILE__) . '/EpiCurl.php';
require_once dirname(__FILE__) . '/EpiOAuth.php';
require_once dirname(__FILE__) . '/EpiTwitter.php';
require_once dirname(dirname(__FILE__)) . '/utils.php';
$consumer_key = get_option('PricerrTheme_twitter_consumer_key');
$consumer_secret = get_option('PricerrTheme_twitter_consumer_secret');
$twitter_api = new EpiTwitter($consumer_key, $consumer_secret);
$twitter_api->setToken($_GET['oauth_token']);
$token = $twitter_api->getAccessToken();
$twitter_api->setToken($token->oauth_token, $token->oauth_token_secret);
$user = $twitter_api->get_accountVerify_credentials();
$user->response;
$name = $user->screen_name;
$screen_name = $user->screen_name;
$twitter_id = $user->id;
$signature = social_connect_generate_signature_pr($twitter_id);
?>

<html>
<head>
<script>
function init() {
  window.opener.wp_social_connect({'action' : 'social_connect', 'social_connect_provider' : 'twitter', 
    'social_connect_signature' : '<?php 
echo $signature;
?>
',
    'social_connect_twitter_identity' : '<?php 
echo $twitter_id;
?>
',
Esempio n. 3
0
<?php

require_once dirname(dirname(__FILE__)) . '/constants.php';
require_once 'facebook.php';
require_once dirname(dirname(__FILE__)) . '/utils.php';
$client_id = get_option('PricerrTheme_facebook_app_id');
$secret_key = get_option('PricerrTheme_facebook_app_secret');
if (isset($_GET['code'])) {
    $code = $_GET['code'];
    $client_id = get_option('PricerrTheme_facebook_app_id');
    $secret_key = get_option('PricerrTheme_facebook_app_secret');
    parse_str(sc_curl_get_contents_pr("https://graph.facebook.com/oauth/access_token?" . 'client_id=' . $client_id . '&redirect_uri=' . urlencode(get_bloginfo('template_url') . '/lib/social/facebook/callback.php') . '&client_secret=' . $secret_key . '&code=' . urlencode($code)));
    $signature = social_connect_generate_signature_pr($access_token);
    ?>
<html>
<head>
<script>
function init() {
  window.opener.wp_social_connect({'action' : 'social_connect', 'social_connect_provider' : 'facebook',
    'social_connect_signature' : '<?php 
    echo $signature;
    ?>
',
    'social_connect_access_token' : '<?php 
    echo $access_token;
    ?>
'});
    
	window.close();
}
</script>