Fix #101
This commit is contained in:
parent
ad6cb61b3b
commit
f81bbe60fe
@ -53,7 +53,7 @@ class DocumentController extends Controller{
|
|||||||
|
|
||||||
$filename = isset($sessionData['genesis_url']) ? $sessionData['genesis_url'] : '';
|
$filename = isset($sessionData['genesis_url']) ? $sessionData['genesis_url'] : '';
|
||||||
$documentsView = new View('/' . $sessionData['owner']);
|
$documentsView = new View('/' . $sessionData['owner']);
|
||||||
$download = new Download($documentsView->initDocumentsView(), $filename);
|
$download = new Download($documentsView->initDocumentsView($sessionData['owner']), $filename);
|
||||||
$download->sendResponse();
|
$download->sendResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -90,4 +90,4 @@ class DocumentController extends Controller{
|
|||||||
|
|
||||||
\OCP\JSON::success(array('documents' => $documents,'sessions' => $sessions,'members' => $members));
|
\OCP\JSON::success(array('documents' => $documents,'sessions' => $sessions,'members' => $members));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,7 +39,7 @@ class Db_Session extends \OCA\Documents\Db {
|
|||||||
list($ownerView, $path) = $file->getOwnerViewAndPath();
|
list($ownerView, $path) = $file->getOwnerViewAndPath();
|
||||||
|
|
||||||
// Create a directory to store genesis
|
// Create a directory to store genesis
|
||||||
$docView = $ownerView->initDocumentsView();
|
$docView = $ownerView->initDocumentsView($file->getOwner());
|
||||||
|
|
||||||
$oldSession = new Db_Session();
|
$oldSession = new Db_Session();
|
||||||
$oldSession->loadBy('file_id', $file->getFileId());
|
$oldSession->loadBy('file_id', $file->getFileId());
|
||||||
|
10
lib/view.php
10
lib/view.php
@ -15,12 +15,12 @@ class View extends \OC\Files\View{
|
|||||||
const DOCUMENTS_DIRNAME='/documents';
|
const DOCUMENTS_DIRNAME='/documents';
|
||||||
protected static $documentsView;
|
protected static $documentsView;
|
||||||
|
|
||||||
public function initDocumentsView(){
|
public function initDocumentsView($owner){
|
||||||
if (!$this->is_dir(self::DOCUMENTS_DIRNAME)) {
|
$ownerView = new View('/' . $owner);
|
||||||
$this->mkdir(self::DOCUMENTS_DIRNAME);
|
if (!$ownerView->is_dir(self::DOCUMENTS_DIRNAME)) {
|
||||||
|
$ownerView->mkdir(self::DOCUMENTS_DIRNAME);
|
||||||
}
|
}
|
||||||
|
return $ownerView;
|
||||||
return new \OC\Files\View( $this->getRoot() . self::DOCUMENTS_DIRNAME);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFilePermissions($path){
|
public function getFilePermissions($path){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user