28 $this->userId =
$USER->GetID();
79 $this->scope = array_diff($this->scope, [
$scope]);
85 $this->scope = array_merge($this->scope,
$scope);
103 return implode(
',', array_map(
'urlencode', array_unique($this->
getScope())));
119 if($this->userId > 0)
121 $dbSocservUser = \Bitrix\Socialservices\UserTable::getList([
123 '=USER_ID' => $this->userId,
124 "=EXTERNAL_AUTH_ID" => static::SERVICE_ID
126 'select' => [
"USER_ID",
"XML_ID",
"OATOKEN",
"OATOKEN_EXPIRES",
"REFRESH_TOKEN",
"PERMISSIONS"]
129 $accessToken = $dbSocservUser->fetch();
136 if($this->userId > 0)
138 $dbSocservUser = \Bitrix\Socialservices\UserTable::getList(
array(
140 '=USER_ID' => $this->userId,
141 "=EXTERNAL_AUTH_ID" => static::SERVICE_ID
143 'select' =>
array(
"ID")
146 while($accessToken = $dbSocservUser->fetch())
148 \Bitrix\Socialservices\UserTable::delete($accessToken[
'ID']);
155 return (($this->accessTokenExpires - 30) < time()) ?
false :
true;
165 $http = new \Bitrix\Main\Web\HttpClient([
166 'socketTimeout' => $this->httpTimeout,
167 'streamTimeout' => $this->httpTimeout,
176 $postResult = $http->get(
$url);
183 catch (\
Bitrix\Main\ArgumentException $e)
185 if (defined(
"BX_SOCIALSERVICES_ERROR_DEBUG"))
188 'post_url' => $http->getEffectiveUrl(),
189 'result_status' => $http->getStatus(),
190 'result_error' => $http->getError(),
191 'result_text' => $http->getResult(),
192 ],
'socialservices', 40);
197 return $decodedResult;
setAccessTokenExpires($accessTokenExpires)
removeScope(string $scope)
__construct($appID, $appSecret, $code=false)
setRefreshToken($refresh_token)
getDecodedJson($url, $postData=null)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
AddMessage2Log($text, $module='', $traceDepth=6, $showArgs=false)
const SOCSERV_DEFAULT_HTTP_TIMEOUT