correctly propagate readonly for sharing and Collabora

This commit is contained in:
Ralf Becker 2018-03-20 11:54:33 +01:00
parent be4696b857
commit d426394685
3 changed files with 8 additions and 2 deletions

View File

@ -912,6 +912,11 @@ class Vfs
return true;
}
}
// if we check writable and have a readonly mount --> return false, as backends dont know about r/o url parameter
if ($check == self::WRITABLE && Vfs\StreamWrapper::url_is_readonly($stat['url']))
{
return false;
}
// check backend for extended acls (only if path given)
$ret = $path && self::_call_on_backend('check_extended_acl',array(isset($stat['url'])?$stat['url']:$path,$check),true); // true = fail silent if backend does not support

View File

@ -214,7 +214,7 @@ class Sharing
}
$share['resolve_url'] = Vfs::resolve_url($share['share_path'], true, true, true, true); // true = fix evtl. contained url parameter
// if share not writable append ro=1 to mount url to make it readonly
if (!self::$db->from_bool($share['share_writable']))
if (!($share['share_writable'] & 1))
{
$share['resolve_url'] .= (strpos($share['resolve_url'], '?') ? '&' : '?').'ro=1';
}

View File

@ -79,7 +79,8 @@ class filemanager_shares extends filemanager_ui
if (class_exists('EGroupware\\Collabora\\Wopi'))
{
$query['col_filter'][] = 'share_writable != '.(int)EGroupware\Collabora\Wopi::WOPI_SHARE;
$query['col_filter'][] = 'share_writable NOT IN ('.
EGroupware\Collabora\Wopi::WOPI_WRITABLE.','.EGroupware\Collabora\Wopi::WOPI_READONLY.')';
}
if ((string)$query['col_filter']['share_passwd'] !== '')