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\Calendar\Sync\Office365\Helper; use Bitrix\Main\DI\ServiceLocator; use Bitrix\Main\HttpApplication; class Office365 extends Base { /** * @throws \Bitrix\Main\ObjectNotFoundException * @throws \Psr\Container\NotFoundExceptionInterface */ protected function __construct($userId) { /** @var Helper $helper */ $helper = ServiceLocator::getInstance()->get('calendar.service.office365.helper'); $this->oauthClient = new \CSocServOffice365OAuth($userId); $this->oauthClient->getEntityOAuth()->addScope($helper::NEED_SCOPE); } /** * @return bool */ protected function checkService(): bool { return \CCalendar::isOffice365ApiEnabled(); } /** * @return string */ public static function getServiceName(): string { return 'office365'; } /** * @return string */ public function getUrl(): string { $isMobile = HttpApplication::getInstance()->getSession()->get('MOBILE_OAUTH'); $mode = $isMobile ? 'bx_mobile' : 'opener'; $backUrl = $isMobile ? null : '#office365AuthSuccess'; return $this->oauthClient->getUrl( $mode, null, [ 'BACKURL' => $backUrl, ] ); } }