uawdijnntqw1x1x1
IP : 13.58.76.154
Hostname : axolotl
Kernel : Linux axolotl 4.9.0-13-amd64 #1 SMP Debian 4.9.228-1 (2020-07-05) x86_64
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
OS : Linux
PATH:
/
var
/
www
/
axolotl
/
data
/
www
/
ekb.axolotls.ru
/
bitrix
/
modules
/
disk
/
lib
/
document
/
office365handler.php
/
/
<?php namespace Bitrix\Disk\Document; use Bitrix\Disk\Document\Upload\Office365ResumableUpload; use Bitrix\Disk\ShowSession; use Bitrix\Disk\TypeFile; use Bitrix\Main\Localization\Loc; use Bitrix\Main\Web\Uri; Loc::loadMessages(__FILE__); class Office365Handler extends OneDriveHandler implements IViewer { const SUFFIX_TO_CREATE_LINK = 'createLink'; const SUFFIX_TO_CREATE_UPLOAD_SESSION = 'createUploadSession'; /** * Internal code. Identificate document handler * * Max length is 10 chars * @throws \Bitrix\Main\NotImplementedException * @return string */ public static function getCode() { return 'office365'; } /** * Public name document handler. May show in user interface. * @throws \Bitrix\Main\NotImplementedException * @return string */ public static function getName() { return Loc::getMessage('DISK_OFFICE365_HANDLER_NAME'); } /** * Public name storage of documents. May show in user interface. * @throws \Bitrix\Main\NotImplementedException * @return string */ public static function getStorageName() { return Loc::getMessage('DISK_OFFICE365_HANDLER_NAME_STORAGE'); } /** * Returns OAuth service for working with OneDrive for Business. * * @return \CSocServOffice365OAuth|\CSocServAuth */ protected function getOAuthService() { return new \CSocServOffice365OAuth($this->userId); } protected function instantiateResumableUpload(FileData $fileData) { return new Office365ResumableUpload($this, $fileData); } /** * Returns url root for API. * * @return string */ protected function getApiUrlRoot() { return $this ->getOAuthService() ->getEntityOAuth() ->getResource() . \COffice365OAuthInterface::VERSION . "/me" ; } /** * Returns scopes. * * @return array */ protected function getScopes() { return array( 'wl.signin', 'wl.offline_access', 'onedrive.readwrite', ); } /** * Gets data for showing preview file. * Array must be contain keys: id, viewUrl, neededDelete, neededCheckView. * * @param FileData $fileData * @return array|null */ public function getDataForViewFile(FileData $fileData) { $dataForViewFile = parent::getDataForViewFile($fileData); if(!$dataForViewFile) { return null; } if(!empty($dataForViewFile['neededDelete'])) { $fileData->setLinkInService($dataForViewFile['viewUrl']); ShowSession::register($this, $fileData, $this->errorCollection); } return $dataForViewFile; } /** * Returns shared link on the document, which possible to use in iframe to view document. * * @param FileData $fileData File data. * @return null|string */ protected function getSharedEmbedLink(FileData $fileData) { /** @see \Bitrix\Disk\Document\OneDriveHandler::getSharedLink() */ $link = $this->retryMethod('getSharedLink', array($fileData, self::SHARED_LINK_TYPE_VIEW)); if($link === null) { return null; } return (new Uri($link))->addParams([ 'action' => 'embedview', 'wdStartOn' => 1, ])->getLocator(); } /** * Shares file to edit for anyone by id. * * @param FileData $fileData * @internal * @return bool */ public function shareFileToEdit(FileData $fileData) { if(!$this->checkRequiredInputParams($fileData->toArray(), array( 'id', ))) { return false; } $linkInService = $this->getSharedLink($fileData, static::SHARED_LINK_TYPE_EDIT); if(!$linkInService) { return false; } $fileData->setLinkInService($linkInService); return true; } /** * Gets a file's metadata by ID. * * @param FileData $fileData * @return array|null Describes file (id, title, size) */ public function getFileMetadata(FileData $fileData) { $fileMetadata = parent::getFileMetadata($fileData); if(empty($fileMetadata['mimeType'])) { $fileMetadata['mimeType'] = TypeFile::getMimeTypeByFilename($fileMetadata['name']); } return $fileMetadata; } protected function getUploadPath(FileData $fileData) { $fileName = $fileData->getName(); $fileName = 'document.' . getFileExtension($fileName); $fileName = $this->convertToUtf8($fileName); $fileName = rawurlencode($fileName); return $this->getApiUrlRoot() . "/drive/root:/'{$fileName}:/"; } }
/var/www/axolotl/data/www/ekb.axolotls.ru/bitrix/modules/disk/lib/document/office365handler.php