summaryrefslogtreecommitdiff
path: root/app/Api/TaskFileApi.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
committerFrederic Guillot <fred@kanboard.net>2016-06-26 10:25:13 -0400
commit4a230d331ec220fc32a48525afb308af0d9787fa (patch)
tree514aa3d703155b7f97a2c77147c9fd74cef60f84 /app/Api/TaskFileApi.php
parent922e0fb6de06a98774418612e0b0f75af72b6dbb (diff)
Added application and project roles validation for API procedure calls
Diffstat (limited to 'app/Api/TaskFileApi.php')
-rw-r--r--app/Api/TaskFileApi.php59
1 files changed, 0 insertions, 59 deletions
diff --git a/app/Api/TaskFileApi.php b/app/Api/TaskFileApi.php
deleted file mode 100644
index 7b27477c..00000000
--- a/app/Api/TaskFileApi.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-
-namespace Kanboard\Api;
-
-use Kanboard\Core\ObjectStorage\ObjectStorageException;
-
-/**
- * Task File API controller
- *
- * @package Kanboard\Api
- * @author Frederic Guillot
- */
-class TaskFileApi extends BaseApi
-{
- public function getTaskFile($file_id)
- {
- return $this->taskFileModel->getById($file_id);
- }
-
- public function getAllTaskFiles($task_id)
- {
- return $this->taskFileModel->getAll($task_id);
- }
-
- public function downloadTaskFile($file_id)
- {
- try {
- $file = $this->taskFileModel->getById($file_id);
-
- if (! empty($file)) {
- return base64_encode($this->objectStorage->get($file['path']));
- }
- } catch (ObjectStorageException $e) {
- $this->logger->error($e->getMessage());
- }
-
- return '';
- }
-
- public function createTaskFile($project_id, $task_id, $filename, $blob)
- {
- try {
- return $this->taskFileModel->uploadContent($task_id, $filename, $blob);
- } catch (ObjectStorageException $e) {
- $this->logger->error($e->getMessage());
- return false;
- }
- }
-
- public function removeTaskFile($file_id)
- {
- return $this->taskFileModel->remove($file_id);
- }
-
- public function removeAllTaskFiles($task_id)
- {
- return $this->taskFileModel->removeAll($task_id);
- }
-}