aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/lib/Controller/ViewController.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files/lib/Controller/ViewController.php')
-rw-r--r--apps/files/lib/Controller/ViewController.php51
1 files changed, 0 insertions, 51 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php
index cdad09d27a1..16d0c3ea1f0 100644
--- a/apps/files/lib/Controller/ViewController.php
+++ b/apps/files/lib/Controller/ViewController.php
@@ -221,61 +221,10 @@ class ViewController extends Controller {
$policy->addAllowedWorkerSrcDomain('\'self\'');
$response->setContentSecurityPolicy($policy);
- $this->provideInitialState($dir, $fileid);
-
return $response;
}
/**
- * Add openFileInfo in initialState.
- * @param string $dir - the ?dir= URL param
- * @param string $fileid - the fileid URL param
- * @return void
- */
- private function provideInitialState(string $dir, ?string $fileid): void {
- if ($fileid === null) {
- return;
- }
-
- $user = $this->userSession->getUser();
-
- if ($user === null) {
- return;
- }
-
- $uid = $user->getUID();
- $userFolder = $this->rootFolder->getUserFolder($uid);
- $node = $userFolder->getFirstNodeById((int) $fileid);
-
- if ($node === null) {
- return;
- }
-
- // properly format full path and make sure
- // we're relative to the user home folder
- $isRoot = $node === $userFolder;
- $path = $userFolder->getRelativePath($node->getPath());
- $directory = $userFolder->getRelativePath($node->getParent()->getPath());
-
- // Prevent opening a file from another folder.
- if ($dir !== $directory) {
- return;
- }
-
- $this->initialState->provideInitialState(
- 'fileInfo', [
- 'id' => $node->getId(),
- 'name' => $isRoot ? '' : $node->getName(),
- 'path' => $path,
- 'directory' => $directory,
- 'mime' => $node->getMimetype(),
- 'type' => $node->getType(),
- 'permissions' => $node->getPermissions(),
- ]
- );
- }
-
- /**
* Redirects to the trashbin file list and highlight the given file id
*
* @param int $fileId file id to show