Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

Commit

Permalink
Fix #300
Browse files Browse the repository at this point in the history
  • Loading branch information
michielbdejong authored and parhamin2010 committed May 19, 2023
1 parent a58ff15 commit 11163b8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/Controller/RevaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -573,10 +573,17 @@ public function EmptyRecycle($userId) {
* @return Http\DataResponse|JSONResponse
*/
public function GetMD($userId) {
error_log("GetMD");
$this->init($userId);
$ref = $this->request->getParam("ref");
$path = $this->revaPathToNextcloudPath($ref["path"]); // FIXME: normalize incoming path
error_log("GetMD " . var_export($ref, true));
if (isset($ref["path"])) {
$revaPath = $ref["path"]; // e.g. GetMD {"ref":{"path":"/home/asdf"},"mdKeys":null}
} else if (isset($ref["resource_id"]) && isset($ref["resource_id"]["opaque_id"]) && str_starts_with($ref["resource_id"]["opaque_id"], "fileid-/home/")) {
$revaPath = substr($ref["resource_id"]["opaque_id"], strlen("fileid-")); // e.g. GetMD {"ref":{"resource_id":{"storage_id":"00000000-0000-0000-0000-000000000000","opaque_id":"fileid-/home/asdf"}},"mdKeys":null}
} else {
throw new \Exception("ref not understood!");
}
$path = $this->revaPathToNextcloudPath($revaPath);
error_log("Looking for nc path '$path' in user folder; reva path '".$ref["path"]."' ");
$dirContents = $this->userFolder->getDirectoryListing();
$paths = array_map(function (\OCP\Files\Node $node) {
Expand Down

0 comments on commit 11163b8

Please sign in to comment.