mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 15:38:27 +01:00
fixing 3 failed litmus tests:
- copy_coll, move_coll: using egw_vfs::find instead of System::find which we dont require and fails anyway for some reason - copy_shallow: by updating COPY with changes from 1.0.0RC6 (depth="0" is allowed for copy, thought HTTP_WebDAV_Server still copies the whole collection!)
This commit is contained in:
parent
38c3e52dde
commit
73450d3817
@ -128,7 +128,28 @@ class vfs_webdav_server extends HTTP_WebDAV_Server_Filesystem
|
|||||||
$source = $this->base .$options["path"];
|
$source = $this->base .$options["path"];
|
||||||
if (!file_exists($source)) return "404 Not found";
|
if (!file_exists($source)) return "404 Not found";
|
||||||
|
|
||||||
|
if (is_dir($source)) { // resource is a collection
|
||||||
|
switch ($options["depth"]) {
|
||||||
|
case "infinity": // valid
|
||||||
|
break;
|
||||||
|
case "0": // valid for COPY only
|
||||||
|
if ($del) { // MOVE?
|
||||||
|
return "400 Bad request";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "1": // invalid for both COPY and MOVE
|
||||||
|
default:
|
||||||
|
return "400 Bad request";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$dest = $this->base . $options["dest"];
|
$dest = $this->base . $options["dest"];
|
||||||
|
$destdir = dirname($dest);
|
||||||
|
|
||||||
|
if (!file_exists($destdir) || !is_dir($destdir)) {
|
||||||
|
return "409 Conflict";
|
||||||
|
}
|
||||||
|
|
||||||
$new = !file_exists($dest);
|
$new = !file_exists($dest);
|
||||||
$existing_col = false;
|
$existing_col = false;
|
||||||
|
|
||||||
@ -158,11 +179,6 @@ class vfs_webdav_server extends HTTP_WebDAV_Server_Filesystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_dir($source) && ($options["depth"] != "infinity")) {
|
|
||||||
// RFC 2518 Section 9.2, last paragraph
|
|
||||||
return "400 Bad request";
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($del) {
|
if ($del) {
|
||||||
if (!rename($source, $dest)) {
|
if (!rename($source, $dest)) {
|
||||||
return "500 Internal server error";
|
return "500 Internal server error";
|
||||||
@ -182,9 +198,8 @@ class vfs_webdav_server extends HTTP_WebDAV_Server_Filesystem
|
|||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
*/
|
*/
|
||||||
} else {
|
} else {
|
||||||
if (is_dir($source)) {
|
if (is_dir($source) && $options['depth'] == 'infinity') {
|
||||||
$files = System::find($source);
|
$files = egw_vfs::find($source,array('depth' => true,'url' => true)); // depth=true: return dirs first, url=true: allow urls!
|
||||||
$files = array_reverse($files);
|
|
||||||
} else {
|
} else {
|
||||||
$files = array($source);
|
$files = array($source);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user