* 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:03:34 +00:00
parent 25fcf25bdb
commit a654002f7b

View File

@ -1304,7 +1304,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;
}