case 'skydrive': case 'sky-drive': case 'onedrive': $serviceEditDoc = CWebDavLogOnlineEditBase::SKYDRIVE_SERVICE_NAME; break; case 'l': case 'local': $serviceEditDoc = CWebDavLogOnlineEditBase::LOCAL_SERVICE_NAME; break; default: $serviceEditDoc = CWebDavLogOnlineEditBase::GOOGLE_SERVICE_NAME; break; } //check: this document edit by another user (with another service?) $wdElement = $ob->GetObject(array('check_permissions' => false), false); $lastSession = CWebDavLogOnlineEdit::getOnlineLastSession(array('IBLOCK_ID' => $wdElement['element_array']['IBLOCK_ID'], 'SECTION_ID' => $wdElement['element_array']['IBLOCK_SECTION_ID'], 'ELEMENT_ID' => $wdElement['element_array']['ID'])); unset($wdElement); if ($lastSession && $lastSession['SERVICE'] != CWebDavLogOnlineEditBase::LOCAL_SERVICE_NAME) { $serviceEditDoc = $lastSession['SERVICE']; unset($lastSession); } if ($serviceEditDoc == CWebDavLogOnlineEditBase::DEFAULT_SERVICE_NAME) { $serviceEditDoc = CWebDavTools::getServiceEditDocForCurrentUser(); } $editComponentParams = array('webdav' => $ob, 'fileId' => (int) $_REQUEST['f'], 'createDoc' => !empty($_REQUEST['createDoc']), 'action' => $_REQUEST['action']); if ($serviceEditDoc == CWebDavLogOnlineEditBase::GOOGLE_SERVICE_NAME) { $APPLICATION->RestartBuffer(); $APPLICATION->IncludeComponent('bitrix:webdav.doc.edit.google', '', $editComponentParams); include $_SERVER["DOCUMENT_ROOT"] . BX_ROOT . "/modules/main/include/epilog_after.php"; die; } elseif ($serviceEditDoc == CWebDavLogOnlineEditBase::SKYDRIVE_SERVICE_NAME) {
protected function getOnlineLastSession() { if ($this->isExclusiveEdit()) { return array(); } $webdav = $this->getWebdav(); return CWebDavLogOnlineEdit::getOnlineLastSession(array('IBLOCK_ID' => $webdav->arParams['element_array']['IBLOCK_ID'], 'SECTION_ID' => $webdav->arParams['element_array']['IBLOCK_SECTION_ID'], 'ELEMENT_ID' => $webdav->arParams['element_array']['ID']), $this->getServiceName()); }