• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/lib/api/user.php
  • Класс: BitrixRestApiUser
  • Вызов: User::onUserInitialize
static function onUserInitialize($arParams, $arHandler)
{
	$ID = $arParams[0];

	$dbRes = CUser::GetByID($ID);
	$arUser = $dbRes->Fetch();

	if(in_array($arUser['EXTERNAL_AUTH_ID'], UserTable::getExternalUserTypes()))
	{
		throw new RestException('Unnecessary event call for this user type');
	}

	$allowedFields = null;
	if ($arHandler['APP_ID'] > 0)
	{
		$app = AppTable::getByClientId($arHandler['APP_CODE']);
		if ($app['SCOPE'])
		{
			$scope = explode(',', $app['SCOPE']);
			$allowedFields = static::getAllowedUserFields($scope);
		}
	}

	$arRes = self::getUserData($arUser, $allowedFields);
	if($arUser['PERSONAL_PHOTO'] > 0)
	{
		$arRes['PERSONAL_PHOTO'] = CRestUtil::GetFile($arUser["PERSONAL_PHOTO"]);
	}

	return $arRes;
}