From f81bbe60fe45a9f2c132dad684da53dd3ad63ffd Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Nov 2013 15:46:30 +0000 Subject: [PATCH] Fix #101 --- ajax/documentController.php | 4 ++-- lib/db/session.php | 2 +- lib/view.php | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ajax/documentController.php b/ajax/documentController.php index 4904e110..560d98da 100644 --- a/ajax/documentController.php +++ b/ajax/documentController.php @@ -53,7 +53,7 @@ class DocumentController extends Controller{ $filename = isset($sessionData['genesis_url']) ? $sessionData['genesis_url'] : ''; $documentsView = new View('/' . $sessionData['owner']); - $download = new Download($documentsView->initDocumentsView(), $filename); + $download = new Download($documentsView->initDocumentsView($sessionData['owner']), $filename); $download->sendResponse(); } @@ -90,4 +90,4 @@ class DocumentController extends Controller{ \OCP\JSON::success(array('documents' => $documents,'sessions' => $sessions,'members' => $members)); } -} \ No newline at end of file +} diff --git a/lib/db/session.php b/lib/db/session.php index 82b07387..ba5c7781 100644 --- a/lib/db/session.php +++ b/lib/db/session.php @@ -39,7 +39,7 @@ class Db_Session extends \OCA\Documents\Db { list($ownerView, $path) = $file->getOwnerViewAndPath(); // Create a directory to store genesis - $docView = $ownerView->initDocumentsView(); + $docView = $ownerView->initDocumentsView($file->getOwner()); $oldSession = new Db_Session(); $oldSession->loadBy('file_id', $file->getFileId()); diff --git a/lib/view.php b/lib/view.php index fc483ba9..a39abf59 100644 --- a/lib/view.php +++ b/lib/view.php @@ -15,12 +15,12 @@ class View extends \OC\Files\View{ const DOCUMENTS_DIRNAME='/documents'; protected static $documentsView; - public function initDocumentsView(){ - if (!$this->is_dir(self::DOCUMENTS_DIRNAME)) { - $this->mkdir(self::DOCUMENTS_DIRNAME); + public function initDocumentsView($owner){ + $ownerView = new View('/' . $owner); + if (!$ownerView->is_dir(self::DOCUMENTS_DIRNAME)) { + $ownerView->mkdir(self::DOCUMENTS_DIRNAME); } - - return new \OC\Files\View( $this->getRoot() . self::DOCUMENTS_DIRNAME); + return $ownerView; } public function getFilePermissions($path){