示例#1
0
 public function __construct()
 {
     parent::__construct();
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('twitter');
     $OAuth2Token = $OAuth2->getToken();
     $this->API = new TwitterOAuth($OAuth2->appSettings['key'], $OAuth2->appSettings['secret'], $OAuth2Token->attribute('token'), $OAuth2Token->attribute('secret'));
 }
示例#2
0
 public function __construct()
 {
     parent::__construct();
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('instagram');
     $OAuth2Token = $OAuth2->getToken()->Token;
     $this->API = array('key' => $OAuth2->appSettings['key'], 'secret' => $OAuth2->appSettings['secret'], 'token' => $OAuth2Token);
 }
示例#3
0
 public function __construct()
 {
     parent::__construct();
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('facebook');
     $this->API = new Facebook($OAuth2->appSettings['key'], $OAuth2->appSettings['secret']);
     $OAuth2Token = $OAuth2->getToken();
     $this->acessToken = $OAuth2Token->attribute('token');
 }
示例#4
0
 protected function getAPI()
 {
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('linkedin');
     $OAuth2Token = $OAuth2->getToken();
     $API = new LinkedIn(array('appKey' => $OAuth2->appSettings['key'], 'appSecret' => $OAuth2->appSettings['secret'], 'callbackUrl' => null));
     $API->setTokenAccess(array('oauth_token' => $OAuth2Token->attribute('token'), 'oauth_token_secret' => $OAuth2Token->attribute('secret')));
     return $API;
 }
示例#5
0
 protected function getAPI()
 {
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('facebook');
     $API = new Facebook($OAuth2->appSettings['key'], $OAuth2->appSettings['secret']);
     $OAuth2Token = $OAuth2->getToken();
     $this->acessToken = $OAuth2Token->attribute('token');
     return $API;
 }
示例#6
0
 public function __construct()
 {
     parent::__construct();
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('google');
     $token = $OAuth2->getToken();
     $tmp = json_decode($token->attribute('token'), true);
     try {
         $OAuth2->connection->refreshToken($tmp['refresh_token']);
         $this->API = new apiPlusService($OAuth2->connection);
     } catch (Exception $e) {
         eZDebug::writeError($e->getMessage(), self::$debugMessagesGroup);
     }
 }
示例#7
0
 protected function __construct()
 {
     parent::__construct();
     $this->OAunth2Connection = nxcSocialNetworksOAuth2::getInstanceByType('google');
 }
示例#8
0
<?php

/**
 * @package nxcSocialNetworks
 * @author  Serhey Dolgushev <*****@*****.**>
 * @date    16 Sep 2012
 **/
$error = false;
try {
    $OAth2 = nxcSocialNetworksOAuth2::getInstanceByType($Params['type']);
} catch (Exception $e) {
    $error = $e->getMessage();
}
if ($error === false) {
    try {
        $scopes = $OAth2->getPersistenceTokenScopes();
        header('Location: ' . $OAth2->getAuthorizeURL($scopes));
        eZExecution::cleanExit();
    } catch (Exception $e) {
        $error = $e->getMessage();
    }
}
$tpl = eZTemplate::factory();
$tpl->setVariable('error', $error);
$Result = array();
$Result['content'] = $tpl->fetch('design:social_networks/settings.tpl');
$Result['path'] = array(array('text' => ezpI18n::tr('extension/nxc_social_networks', 'Social Network Tokens Management'), 'url' => false));
示例#9
0
 protected function getAPI()
 {
     $OAuth2 = nxcSocialNetworksOAuth2::getInstanceByType('twitter');
     $OAuth2Token = $OAuth2->getToken();
     return new TwitterOAuth($OAuth2->appSettings['key'], $OAuth2->appSettings['secret'], $OAuth2Token->attribute('token'), $OAuth2Token->attribute('secret'));
 }