Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
	$row = $dbSocservUser->Fetch();
	if(!$row || empty($row['OATOKEN']))
	{
		$APPLICATION->RestartBuffer();
		echo <<<HTML
<script type="text/javascript">
	window.location.href = "{$googleOAuth}";
</script>
HTML;
	}
	else
	{
		//todo drive edit
		//require_once $_SERVER['DOCUMENT_ROOT'].'/'.BX_ROOT.'/modules/drive/worker.php';
		$appID = trim(CSocServGoogleOAuth::GetOption("google_appid"));
		$appSecret = trim(CSocServGoogleOAuth::GetOption("google_appsecret"));

		$oauthCredentials = new OauthCredentials($row['OATOKEN'], '', time(), 3600, $appID, $appSecret);

		if(!empty($_REQUEST['commit']) && !empty($_REQUEST['id']))
		{

			$filename = CTempFile::GetFileName(uniqid('_wd'));
			CheckDirPath($filename);
			file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/log_deb.txt', var_export('in commit', true), FILE_APPEND);
			$doc = downloadDoc($_REQUEST['id'], $ob->get_mime_type($ob->_path), $oauthCredentials);
			$a = removeDoc($_REQUEST['id'], $oauthCredentials);
			file_put_contents($filename, $doc['content']);
			$options = array(
				'new' => false,
				'FILE_NAME' => $ob->arParams['element_name'],