1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
PlatformContext.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Controller\Filter;
4
5use Bitrix\Im\Bot;
6use Bitrix\Main\Engine\ActionFilter\Base;
7use Bitrix\Main\Event;
8use Bitrix\Rest\SessionAuth\Auth;
9use CRestServer;
10
11class PlatformContext extends Base
12{
13 public function onBeforeAction(Event $event)
14 {
15 $server = $this->getAction()->getArguments()['restServer'] ?? null;
16
17 if ($server instanceof CRestServer && $server->getAuthType() !== Auth::AUTH_TYPE)
18 {
19 $context = $this->getAction()->getController()->getRequest()->getValues()['platformContext'] ?? null;
20
21 if (is_string($context))
22 {
23 Bot::setPlatformContext($context);
24 }
25 }
26
27 return null;
28 }
29}
const AUTH_TYPE
Определения auth.php:18
$context
Определения csv_new_setup.php:223
$event
Определения prolog_after.php:141