Merge branch 'master' of https://github.com/redmatrix/redmatrix
several dav fixes Conflicts: include/items.php
This commit is contained in:
@@ -414,14 +414,13 @@ class RedDirectory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
|
||||
$os_path = '';
|
||||
|
||||
for ($x = 1; $x < count($path_arr); $x++) {
|
||||
$r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and uid = %d and (flags & %d)>0",
|
||||
$r = q("select id, hash, filename, flags, is_dir from attach where folder = '%s' and filename = '%s' and uid = %d and is_dir != 0",
|
||||
dbesc($folder),
|
||||
dbesc($path_arr[$x]),
|
||||
intval($channel_id),
|
||||
intval(ATTACH_FLAG_DIR)
|
||||
intval($channel_id)
|
||||
);
|
||||
|
||||
if ($r && ( $r[0]['flags'] & ATTACH_FLAG_DIR)) {
|
||||
if ($r && intval($r[0]['is_dir'])) {
|
||||
$folder = $r[0]['hash'];
|
||||
if (strlen($os_path))
|
||||
$os_path .= '/';
|
||||
|
||||
@@ -300,7 +300,7 @@ class RedFile extends DAV\Node implements DAV\IFile {
|
||||
}
|
||||
|
||||
if ($this->auth->owner_id !== $this->auth->channel_id) {
|
||||
if (($this->auth->observer !== $this->data['creator']) || ($this->data['flags'] & ATTACH_FLAG_DIR)) {
|
||||
if (($this->auth->observer !== $this->data['creator']) || intval($this->data['is_dir'])) {
|
||||
throw new DAV\Exception\Forbidden('Permission denied.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user