combine if statements
This commit is contained in:
parent
039f730700
commit
d0e6fdba4d
|
@ -285,19 +285,6 @@ class ShareController extends Controller {
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
$rootFolder = null;
|
|
||||||
if ($share->getNode() instanceof \OCP\Files\Folder) {
|
|
||||||
/** @var \OCP\Files\Folder $rootFolder */
|
|
||||||
$rootFolder = $share->getNode();
|
|
||||||
|
|
||||||
try {
|
|
||||||
$folderNode = $rootFolder->get($path);
|
|
||||||
} catch (\OCP\Files\NotFoundException $e) {
|
|
||||||
$this->emitAccessShareHook($share, 404, 'Share not found');
|
|
||||||
throw new NotFoundException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$shareTmpl = [];
|
$shareTmpl = [];
|
||||||
$shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName();
|
$shareTmpl['displayName'] = $this->userManager->get($share->getShareOwner())->getDisplayName();
|
||||||
$shareTmpl['owner'] = $share->getShareOwner();
|
$shareTmpl['owner'] = $share->getShareOwner();
|
||||||
|
@ -316,6 +303,16 @@ class ShareController extends Controller {
|
||||||
// Show file list
|
// Show file list
|
||||||
$hideFileList = false;
|
$hideFileList = false;
|
||||||
if ($share->getNode() instanceof \OCP\Files\Folder) {
|
if ($share->getNode() instanceof \OCP\Files\Folder) {
|
||||||
|
/** @var \OCP\Files\Folder $rootFolder */
|
||||||
|
$rootFolder = $share->getNode();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$folderNode = $rootFolder->get($path);
|
||||||
|
} catch (\OCP\Files\NotFoundException $e) {
|
||||||
|
$this->emitAccessShareHook($share, 404, 'Share not found');
|
||||||
|
throw new NotFoundException();
|
||||||
|
}
|
||||||
|
|
||||||
$shareTmpl['dir'] = $rootFolder->getRelativePath($folderNode->getPath());
|
$shareTmpl['dir'] = $rootFolder->getRelativePath($folderNode->getPath());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue