1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
office365.php
См. документацию.
1<?php
2
3namespace Bitrix\Calendar\Core\Oauth;
4
5use Bitrix\Calendar\Sync\Office365\Helper;
6use Bitrix\Main\DI\ServiceLocator;
7use Bitrix\Main\HttpApplication;
8
9class Office365 extends Base
10{
15 protected function __construct($userId)
16 {
18 $helper = ServiceLocator::getInstance()->get('calendar.service.office365.helper');
19
20 $this->oauthClient = new \CSocServOffice365OAuth($userId);
21 $this->oauthClient->getEntityOAuth()->addScope($helper::NEED_SCOPE);
22 }
23
27 protected function checkService(): bool
28 {
29 return \CCalendar::isOffice365ApiEnabled();
30 }
31
35 public static function getServiceName(): string
36 {
37 return 'office365';
38 }
39
43 public function getUrl(): string
44 {
45 $isMobile = HttpApplication::getInstance()->getSession()->get('MOBILE_OAUTH');
46 $mode = $isMobile ? 'bx_mobile' : 'opener';
47 $backUrl = $isMobile ? null : '#office365AuthSuccess';
48
49 return $this->oauthClient->getUrl(
50 $mode,
51 null,
52 [
53 'BACKURL' => $backUrl,
54 ]
55 );
56 }
57}
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
static getServiceName()
Определения office365.php:35
if($request->getPost('Update') !==null) elseif( $request->getPost( 'Apply') !==null) elseif($request->getPost('RestoreDefaults') !==null) $backUrl
Определения options.php:66