* WebDAV: allow locking of not (yet) existing files to create them

- failed before as there are no write-rights for not existing files
- now we check for not existing files the write rights of the parent directory
This commit is contained in:
Ralf Becker 2011-08-30 17:04:20 +00:00
parent 32ba7803f3
commit 7f91228840

View File

@ -1283,7 +1283,8 @@ class egw_vfs extends vfs_stream_wrapper
static function lock($path,&$token,&$timeout,&$owner,&$scope,&$type,$update=false,$check_writable=true)
{
// we require write rights to lock/unlock a resource
if (!$path || $update && !$token || $check_writable && !egw_vfs::is_writable($path))
if (!$path || $update && !$token || $check_writable &&
!(egw_vfs::is_writable($path) || !egw_vfs::file_exists($path) && egw_vfs::is_writable(egw_vfs::dirname($path))))
{
return false;
}