public function getEntityOAuth($code = false) { if (!$this->entityOAuth) { $this->entityOAuth = new CGooglePlusOAuthInterface(); } return parent::getEntityOAuth($code); }
public function __construct($appID = false, $appSecret = false, $code = false) { if ($appID === false) { $appID = trim(CSocServGoogleOAuth::GetOption("google_appid")); } if ($appSecret === false) { $appSecret = trim(CSocServGoogleOAuth::GetOption("google_appsecret")); } $this->httpTimeout = SOCSERV_DEFAULT_HTTP_TIMEOUT; $this->appID = $appID; $this->appSecret = $appSecret; $this->code = $code; }
/** * 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_GOOGLE_HANDLER_ERROR_NOT_INSTALLED_SOCSERV'), self::ERROR_NOT_INSTALLED_SOCSERV))); return false; } $socGoogleOAuth = new \CSocServGoogleOAuth($this->userId); //this bug. SocServ fill entityOAuth in method getUrl..... $socGoogleOAuth->getUrl('modal', 'https://www.googleapis.com/auth/drive'); $this->accessToken = $socGoogleOAuth->getStorageToken(); return $this; }
public function __construct($appID = false, $appSecret = false, $code = false) { if ($appID === false) { $appID = trim(CSocServGoogleOAuth::GetOption("google_appid")); } if ($appSecret === false) { $appSecret = trim(CSocServGoogleOAuth::GetOption("google_appsecret")); } parent::__construct($appID, $appSecret, $code); }
$o["URL"] = $ob->_path; $o["BASE_URL"] = $arResult['BASE_URL']; $o["DESCRIPTION"] = (array_key_exists("DESCRIPTION", $_REQUEST) ? $_REQUEST["DESCRIPTION"] : ""); $fileOptT = CWebDavExtLinks::GetFileOptions($ob); $o["F_SIZE"] = $fileOptT["F_SIZE"]; CWebDavExtLinks::GetExtLink($arParams, $o); } if(!empty($_REQUEST['editInGoogle'])) { CUtil::JSPostUnescape(); CWebDavExtLinks::CheckSessID(); CWebDavExtLinks::CheckRights($ob); CModule::IncludeModule('socialservices'); $socGoogleOAuth = new CSocServGoogleOAuth(); $googleOAuth = CUtil::JSEscape($socGoogleOAuth->GetFormHtml(array('GET_URL' => true))); $oAuthManager = new CSocServAuthManager(); $arServices = $oAuthManager->GetActiveAuthServices(array());//check active google oauth service $dbSocservUser = CSocServAuthDB::GetList(array(), array('EXTERNAL_AUTH_ID' => 'GoogleOAuth', 'USER_ID' => $USER->GetId())); $row = $dbSocservUser->Fetch(); if(!$row || empty($row['OATOKEN'])) { $APPLICATION->RestartBuffer(); echo <<<HTML <script type="text/javascript"> window.location.href = "{$googleOAuth}"; </script> HTML; }
protected function getOAuthUrlBySocServ() { $socGoogleOAuth = new CSocServGoogleOAuth($this->getUser()->getId()); $googleOAuthUrl = $socGoogleOAuth->getUrl('modal', CWebDavEditDocGoogle::$SCOPE); return $googleOAuthUrl; }