/** * @param $object */ protected function serviceAuth(ilObjCloud $object) { global $ilCtrl; try { $service = ilCloudConnector::getServiceClass($object->getServiceName(), $object->getId()); $service->authService($ilCtrl->getLinkTarget($this, "afterServiceAuth") . "&authMode=true"); } catch (Exception $e) { ilUtil::sendFailure($e->getMessage(), true); ilObjectGUI::redirectToRefId($this->parent_id); } }
/** * @param $id * @throws ilCloudException */ public function downloadFromService($id) { try { $service = ilCloudConnector::getServiceClass($this->getServiceName(), $this->getId()); $node = $this->getNodeFromId($id); $service->getFile($node->getPath(), $this); } catch (Exception $e) { if ($e instanceof ilCloudException) { throw $e; } throw new ilCloudException(ilCloudException::DOWNLOAD_FAILED, $e->getMessage()); } }