• Модуль: im
  • Путь к файлу: ~/bitrix/modules/im/classes/general/im_rest.php
  • Класс: CIMRestService
  • Вызов: CIMRestService::videoconfUpdate
static function videoconfUpdate($arParams, $n, CRestServer $server)
{
	throw new BitrixRestRestException('This method is not available', 'METHOD_NOT_AVAILABLE', CRestServer::STATUS_WRONG_REQUEST);

	$arParams = array_change_key_case($arParams, CASE_UPPER);

	if (
		BitrixImUser::getInstance()->isExtranet()
		|| BitrixImUser::getInstance()->isBot()
	)
	{
		throw new BitrixRestRestException("Only intranet users have access to this method.", "ACCESS_ERROR", CRestServer::STATUS_FORBIDDEN);
	}

	$arParams['BROADCAST_MODE'] = ($arParams['BROADCAST_MODE'] ?? 'N') === 'Y';

	if (!isset($arParams['ID']) || (int)$arParams['ID'] <= 0)
	{
		throw new BitrixRestRestException("Conference ID can't be empty", "CONFERENCE_ID_EMPTY", CRestServer::STATUS_WRONG_REQUEST);
	}

	$conference = BitrixImCallConference::getById((int)$arParams['ID']);

	if (!$conference)
	{
		throw new BitrixRestRestException("Conference with such id not found.", "CONFERENCE_NOT_FOUND", CRestServer::STATUS_WRONG_REQUEST);
	}

	if (!$conference->canUserEdit(BitrixMainEngineCurrentUser::get()->getId()))
	{
		throw new BitrixRestRestException("You can't edit the conference.", "ACCESS_ERROR", CRestServer::STATUS_FORBIDDEN);
	}

	$updateResult = $conference->update($arParams);

	if (!$updateResult->isSuccess())
	{
		$error = $updateResult->getErrors()[0];
		throw new BitrixRestRestException($error->getMessage(), $error->getCode(), CRestServer::STATUS_WRONG_REQUEST);
	}

	return $updateResult->isSuccess();
}