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/ilovecveti.ru/bitrix/modules/calendar/lib/core/oauth/ |
Upload File : |
<?php namespace Bitrix\Calendar\Core\Oauth; use Bitrix\Main\Engine\UrlManager; use Bitrix\Main\Loader; use Bitrix\Main\Security\Random; use Bitrix\Main\Web\Uri; abstract class Base { /** * @var \CSocServAuth */ protected \CSocServAuth $oauthClient; /** * @var string */ protected string $serviceName; /** * @return static|null * @throws \Bitrix\Main\LoaderException */ public static function getInstance(): ?static { if (!Loader::includeModule('socialservices')) { return null; } if (!$userId = \CCalendar::GetCurUserId()) { return null; } $className = static::class; $instance = new $className($userId); if (!$instance->checkService()) { return null; } $instance->serviceName = $className::getServiceName(); return $instance; } /** * @param $userId */ abstract protected function __construct($userId); /** * @return string */ abstract public function getUrl(): string; /** * @return bool */ abstract protected function checkService(): bool; /** * @return string */ abstract public static function getServiceName(): string; }