• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/vkontakte.php
  • Класс: CVKontakteOAuthInterface
  • Вызов: CVKontakteOAuthInterface::GetCurrentUser
public function GetCurrentUser()
{
	if ($this->access_token === false)
	{
		return false;
	}

	$h = new BitrixMainWebHttpClient(array(
		"socketTimeout" => $this->httpTimeout,
		"streamTimeout" => $this->httpTimeout,
	));


	$result = $h->get(self::CONTACTS_URL . '?v='.self::API_VERSION.'&fields=uid,first_name,last_name,nickname,screen_name,sex,bdate,city,country,timezone,photo,photo_medium,photo_max_orig,photo_rec,email&access_token=' . urlencode($this->access_token));

	try
	{
		$result = BitrixMainWebJson::decode($result);
	} catch (BitrixMainArgumentException $e)
	{
		$result = array();
	}

	return $result;
}