3namespace Bitrix\Calendar\Core\Oauth;
5use Bitrix\Calendar\Sync\Office365\Helper;
6use Bitrix\Main\DI\ServiceLocator;
7use Bitrix\Main\HttpApplication;
18 $helper = ServiceLocator::getInstance()->get(
'calendar.service.office365.helper');
20 $this->oauthClient = new \CSocServOffice365OAuth(
$userId);
21 $this->oauthClient->getEntityOAuth()->addScope($helper::NEED_SCOPE);
29 return \CCalendar::isOffice365ApiEnabled();
45 $isMobile = HttpApplication::getInstance()->getSession()->get(
'MOBILE_OAUTH');
46 $mode = $isMobile ?
'bx_mobile' :
'opener';
47 $backUrl = $isMobile ? null :
'#office365AuthSuccess';
49 return $this->oauthClient->getUrl(
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
if($request->getPost('Update') !==null) elseif( $request->getPost( 'Apply') !==null) elseif($request->getPost('RestoreDefaults') !==null) $backUrl