1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
seo_client.php
См. документацию.
1<?php
2/*
3This is callback page for Dropbox OAuth 2.0 authentication.
4Dropbox redirects only to specific back url set in the OAuth application.
5The page opens in popup window after user authorized on Dropbox.
6*/
7
8define("NO_KEEP_STATISTIC", "Y");
9define("NO_AGENT_STATISTIC","Y");
10define("DisableEventsCheck", true);
11define("NO_AGENT_CHECK", true);
12
13define('SKIP_TEMPLATE_AUTH_ERROR', true);
14define('NOT_CHECK_PERMISSIONS', true);
15
16require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/prolog_before.php");
17
18$clientId = (int)($_REQUEST['proxy_client_id'] ?? 0);
19$engine = (string)($_REQUEST['engine'] ?? '');
20
21$clearCache = static function (int $clientId, string $engine)
22{
23 if (CModule::IncludeModule('seo'))
24 {
27 }
28};
29
30if (isset($_REQUEST['isMobileApp']))
31{
33
34 header('Location: bitrix24://');
35 exit;
36}
37
38if (isset($_REQUEST["action"]) && $_REQUEST["action"] == 'web_hook')
39{
40 if (CModule::IncludeModule("seo") && CModule::IncludeModule("socialservices"))
41 {
42 \Bitrix\Seo\WebHook\Service::listen();
43 exit;
44 }
45}
46
47if (isset($_REQUEST["action"]) && $_REQUEST["action"] === 'catalog_callback')
48{
49 if (CModule::IncludeModule("seo") && CModule::IncludeModule("socialservices"))
50 {
52 if ($serviceLocator->has('seo.catalog.webhook.handler'))
53 {
54 $serviceLocator->get('seo.catalog.webhook.handler')->handle();
55 }
56 }
57}
58
59if(CModule::IncludeModule("socialservices") && CSocServAuthManager::CheckUniqueKey())
60{
61 if(isset($_REQUEST["authresult"]))
62 {
64
65 $jsEventData = [
66 'reload' => true,
67 'engine' => $engine,
68 'clientId' => $clientId > 0 ? $clientId : '',
69 ];
70 ?>
71 <script>
72 var eventData = <?=CUtil::PhpToJSObject($jsEventData)?>;
73 window.opener.BX.onCustomEvent(
74 window,
75 'seo-client-auth-result',
76 [eventData]
77 );
78 if (eventData.reload)
79 {
80 opener.location.reload();
81 }
82 window.close();
83 </script>
84 <?
85 }
86}
87
88require_once($_SERVER['DOCUMENT_ROOT']."/bitrix/modules/main/include/epilog_after.php");
static getInstance()
Определения servicelocator.php:33
static handleEvent($clientId, $engineCode)
Определения queueeventhandler.php:157
static clearClientsCache($engine=null, $clientId=null)
Определения service.php:191
static CheckUniqueKey($bUnset=true)
Определения authmanager.php:351
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
$engine
Определения options.php:121
$clientId
Определения seo_client.php:18
$clearCache
Определения seo_client.php:21