Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/calendar/services/ |
Upload File : |
<?php use Bitrix\Calendar\Sync\Managers\PushManager; use Bitrix\Im\Common; use Bitrix\Main\Application; use Bitrix\Main\Loader; use Bitrix\Main\Web\Json; const NOT_CHECK_PERMISSIONS = true; require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/prolog_before.php"); $getPut = function () { $result = ''; if ($putdata = fopen("php://input", "w")) { while ($data = fread($putdata, 1024)) { $result .= $data; } fclose($putdata); } return $result ? Json::decode($result) : []; }; // this logic must have for validate of url (function (): void { if (!empty($_REQUEST['validationToken'])) { $token = htmlspecialcharsbx($_REQUEST['validationToken']); die($token); } })(); Loader::includeModule('calendar'); Loader::includeModule('dav'); $manager = new PushManager(); $data = $getPut(); if (!empty($data['value']) && is_array($data['value'])) { foreach ($data['value'] as $changeData) { if (!empty($changeData['subscriptionId']) && !empty($changeData['clientState'])) { $resourceId = htmlspecialcharsbx($changeData['subscriptionId']); $channelId = htmlspecialcharsbx($changeData['clientState']); try { $manager->handlePush($channelId, $resourceId); } catch (\Exception $e) { } } } } Application::getInstance()->end();