Permalink
Browse files

Api V2 : cross_repository_copy not yet implemented, throw exception.

  • Loading branch information...
1 parent 9b2f6fd commit f856159751a4c32cb21d7947707975ebdb10302b @cdujeu cdujeu committed Sep 3, 2016
Showing with 9 additions and 1 deletion.
  1. +9 −1 core/src/plugins/access.fs/FsAccessDriver.php
@@ -339,7 +339,15 @@ public function createResourceAction(ServerRequestInterface &$request, ResponseI
if(isSet($params["copy_source"])){
$newVars["dest"] = PathUtils::forwardSlashDirname($notDecodedPath);
$newVars["targetBaseName"] = PathUtils::forwardSlashBasename($notDecodedPath);
- $newVars["file"] = "/".implode("/", array_slice(explode("/", trim($params["copy_source"], "/")), 1));
+
+ $sourceParts = explode("/", trim($params["copy_source"], "/"));
+ $sourceRepo = array_shift($sourceParts);
+ $newVars["file"] = "/".implode("/", $sourceParts);
+ $currentRepo = $ctx->getRepositoryId()."";
+ if($currentRepo !== $sourceRepo){
+ // Cross repo, invert parameters and forward to parent method!
+ throw new PydioException("Cross Repository copy is not implemented on this api.");
+ }
if(isSet($params["delete_source"]) && $params["delete_source"] == "true"){
$newAction = "move";
}else{

0 comments on commit f856159

Please sign in to comment.