• Модуль: disk
  • Путь к файлу: ~/bitrix/modules/disk/lib/bitrix24disk/legacy/storagecontroller.php
  • Класс: BitrixDiskBitrix24DiskLegacyStorageController
  • Вызов: StorageController::processActionUnlock
protected function processActionUnlock()
{
	$this->checkRequiredPostParams(array('id', 'extra', 'storageExtra', 'storageId'));
	if($this->errorCollection->hasErrors())
	{
		$this->sendJsonErrorResponse();
	}

	$id = $this->request->getPost('id');

	$storage = $this->getStorageObject($this->request->getPost('storageExtra'), $this->request->getPost('storageId'));
	$extra = $storage->parseElementExtra($this->request->getPost('extra'));

	$file = $storage->getFile($id, $extra);
	if(!$file)
	{
		$this->sendJsonResponse(array(
			'status' => static::STATUS_NOT_FOUND,
		));
	}

	if($storage->unlockFile($file))
	{
		$this->sendJsonSuccessResponse();
	}
	else
	{
		$this->sendJsonErrorResponse();
	}
}