aboutsummaryrefslogtreecommitdiffstats
path: root/include/RedDAV
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-07-30 17:11:16 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-07-30 17:11:16 -0700
commitd5a40cac25e1bcc936a4010ec0038f8e5143c0a0 (patch)
treeb071675ce7137dd5fc74b4ee47776dad68424796 /include/RedDAV
parentdf41ce9536ad72cdc2d1edb1983a48519223da77 (diff)
parent1097cd25830bc11d9aacf24f0e43322d6f397ca3 (diff)
downloadvolse-hubzilla-d5a40cac25e1bcc936a4010ec0038f8e5143c0a0.tar.gz
volse-hubzilla-d5a40cac25e1bcc936a4010ec0038f8e5143c0a0.tar.bz2
volse-hubzilla-d5a40cac25e1bcc936a4010ec0038f8e5143c0a0.zip
Merge branch 'master' of https://github.com/redmatrix/redmatrix
several dav fixes Conflicts: include/items.php
Diffstat (limited to 'include/RedDAV')
-rw-r--r--include/RedDAV/RedDirectory.php7
-rw-r--r--include/RedDAV/RedFile.php2
2 files changed, 4 insertions, 5 deletions
diff --git a/include/RedDAV/RedDirectory.php b/include/RedDAV/RedDirectory.php
index 1f7ba8927..ee01d4a17 100644
--- a/include/RedDAV/RedDirectory.php
+++ b/include/RedDAV/RedDirectory.php
@@ -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 .= '/';
diff --git a/include/RedDAV/RedFile.php b/include/RedDAV/RedFile.php
index e4f9c21b9..b33b30832 100644
--- a/include/RedDAV/RedFile.php
+++ b/include/RedDAV/RedFile.php
@@ -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.');
}
}