aboutsummaryrefslogtreecommitdiffstats
path: root/include/reddav.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-05 16:37:07 -0800
committerfriendica <info@friendica.com>2014-01-05 16:37:07 -0800
commit0297241a64b41fdac34d5fa0bd1cb03a961a88e3 (patch)
treea084ebdd6118ebebd6c50a58fe98e8d8a4b703f8 /include/reddav.php
parent061894d37f9883c8c5033a2e75337660dbc39ad9 (diff)
downloadvolse-hubzilla-0297241a64b41fdac34d5fa0bd1cb03a961a88e3.tar.gz
volse-hubzilla-0297241a64b41fdac34d5fa0bd1cb03a961a88e3.tar.bz2
volse-hubzilla-0297241a64b41fdac34d5fa0bd1cb03a961a88e3.zip
some dav cleanup
Diffstat (limited to 'include/reddav.php')
-rw-r--r--include/reddav.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/reddav.php b/include/reddav.php
index beec0ac21..1e2962972 100644
--- a/include/reddav.php
+++ b/include/reddav.php
@@ -104,13 +104,13 @@ class RedDirectory extends DAV\Node implements DAV\ICollection {
return;
}
- if(! perm_is_allowed($this->auth->channel_id,$this->auth->observer,'view_storage')) {
+ if(($this->auth->owner_id) && (! perm_is_allowed($this->auth->owner_id,$this->auth->observer,'view_storage'))) {
throw new DAV\Exception\Forbidden('Permission denied.');
return;
}
- return RedCollectionData($this->red_path,$this->auth);
-
+ $contents = RedCollectionData($this->red_path,$this->auth);
+ return $contents;
}
@@ -469,9 +469,9 @@ logger('dbg1: ' . print_r($r,true));
$folder = '';
for($x = 1; $x < count($path_arr); $x ++) {
- $r = q("select id, hash, filename, flags from attach where folder = '%s' and (flags & %d)",
+ $r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and (flags & %d)",
dbesc($folder),
- intval($channel_id),
+ dbesc($path_arr[$x]),
intval(ATTACH_FLAG_DIR)
);
if($r && ( $r[0]['flags'] & ATTACH_FLAG_DIR)) {
@@ -567,8 +567,9 @@ logger('file=' . $file);
for($x = 1; $x < count($path_arr); $x ++) {
dbg(1);
- $r = q("select id, hash, filename, flags from attach where folder = '%s' and uid = %d and (flags & %d) $perms",
+ $r = q("select id, hash, filename, flags from attach where folder = '%s' and filename = '%s' and uid = %d and (flags & %d) $perms",
dbesc($folder),
+ dbesc($path_arr[$x]),
intval($channel_id),
intval(ATTACH_FLAG_DIR)
);