• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_request.php
  • Класс: CCalendarRequest
  • Вызов: CCalendarRequest::Process
static function Process(CCalendar $calendar, $action = '')
{
	global $APPLICATION;

	self::$request = BitrixMainContext::getCurrent()->getRequest()->toArray();

	if (($_REQUEST['skip_unescape'] ?? null) !== 'Y')
	{
		CUtil::decodeURIComponent(self::$request);
		CUtil::JSPostUnEscape();
	}

	self::$calendar = $calendar;

	// Export calendar
	if ($action === 'export')
	{
		// We don't need to check access  couse we will check security SIGN from the URL
		$sectId = (int)$_GET['sec_id'];
		if (($_GET['check'] ?? null) === 'Y') // Just for access check from calendar interface
		{
			$APPLICATION->RestartBuffer();
			if (CCalendarSect::CheckSign($_GET['sign'], (int)$_GET['user'], $sectId > 0 ? $sectId : 'superposed_calendars'))
			{
				echo 'BEGIN:VCALENDAR';
			}
			CMain::FinalActions();
			die();
		}

		if ($sectId > 0 && CCalendarSect::CheckAuthHash())
		{
			// We don't need any warning in .ics file
			error_reporting(E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR|E_PARSE);
			CCalendarSect::ReturnICal(array(
				'sectId' => $sectId,
				'userId' => (int)$_GET['user'],
				'sign' => $_GET['sign'],
				'type' => $_GET['type'],
				'ownerId' => (int)$_GET['owner']
			));
		}
		else
		{
			$APPLICATION->RestartBuffer();
		}
	}
	else
	{
		// Check the access
		$accessController = new TypeAccessController(CCalendar::GetUserId());
		$typeModel = TypeModel::createFromXmlId(CCalendar::GetType());
		$action = ActionDictionary::ACTION_TYPE_VIEW;

		if (!$accessController->check($action, $typeModel) || !check_bitrix_sessid())
		{
			$APPLICATION->ThrowException(Loc::getMessage("EC_ACCESS_DENIED"));
			return false;
		}

		$APPLICATION->ShowAjaxHead();
		$APPLICATION->RestartBuffer();
		self::$reqId = (int)$_REQUEST['reqId'];

		switch ($action)
		{
			case 'set_meeting_status':
				self::SetStatus();
				break;
			case 'get_planner':
				self::GetPlanner();
				break;
			case 'update_planner':
				self::UpdatePlanner();
				break;
			case 'get_destination_items':
				self::getDestinationItems();
				break;
		}
	}

	if($ex = $APPLICATION->GetException())
	{
		ShowError($ex->GetString());
	}

	CMain::FinalActions();
	die();
}