Exemple #1
0
 protected function getOAuthUrlBySocServ()
 {
     $socGoogleOAuth = new CSocServLiveIDOAuth($this->getUser()->getId());
     $liveIdOAuthUrl = $socGoogleOAuth->getUrl('modal', CWebDavEditSkyDrive::$SCOPE);
     return $liveIdOAuthUrl;
 }
Exemple #2
0
 public function __construct($appID = false, $appSecret = false, $appKey = false, $code = false)
 {
     if ($appID === false) {
         $appID = trim(CSocServLiveIDOAuth::GetOption("odnoklassniki_appid"));
     }
     if ($appSecret === false) {
         $appSecret = trim(CSocServLiveIDOAuth::GetOption("odnoklassniki_appsecret"));
     }
     if ($appKey === false) {
         $appKey = trim(CSocServLiveIDOAuth::GetOption("odnoklassniki_appkey"));
     }
     $this->httpTimeout = SOCSERV_DEFAULT_HTTP_TIMEOUT;
     $this->appID = $appID;
     $this->appSecret = $appSecret;
     $this->code = $code;
     $this->appKey = $appKey;
 }
 /**
  * Request and store access token (self::accessToken) for self::userId
  * @return $this
  */
 public function queryAccessToken()
 {
     if (!Loader::includeModule('socialservices')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('DISK_ONEDRIVE_HANDLER_ERROR_NOT_INSTALLED_SOCSERV'), self::ERROR_NOT_INSTALLED_SOCSERV)));
         return false;
     }
     $socLiveIdOAuth = new \CSocServLiveIDOAuth($this->userId);
     //this bug. SocServ fill entityOAuth in method getUrl.....
     $socLiveIdOAuth->getUrl('modal', array('wl.contacts_skydrive', 'wl.skydrive_update', 'wl.skydrive'));
     $this->accessToken = $socLiveIdOAuth->getStorageToken();
     return $this;
 }