• Модуль: imopenlines
  • Путь к файлу: ~/bitrix/modules/imopenlines/lib/rest.php
  • Класс: BitrixImOpenLinesRest
  • Вызов: Rest::sessionIntercept
static function sessionIntercept($arParams, $n, CRestServer $server)
{
	$arParams['CHAT_ID'] = (int)$arParams['CHAT_ID'];
	if ($arParams['CHAT_ID'] <= 0)
	{
		throw new RestException('Chat ID can't be empty', 'CHAT_ID_EMPTY', CRestServer::STATUS_WRONG_REQUEST);
	}

	$control = new Operator($arParams['CHAT_ID']);
	$result = $control->interceptSession();

	if (!$result)
	{
		throw new RestException('You can not redirect to this operator', 'OPERATOR_WRONG', CRestServer::STATUS_WRONG_REQUEST);
	}

	return true;
}